This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Make the change of tab size in TUI mode effective immediately
- From: Eli Zaretskii <eliz at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 16 Jan 2015 15:48:26 -0000
- Subject: [binutils-gdb] Make the change of tab size in TUI mode effective immediately
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cb86fcc13bea494007a103424c8a61f1cb372717
commit cb86fcc13bea494007a103424c8a61f1cb372717
Author: Eli Zaretskii <eliz@gnu.org>
Date: Fri Jan 16 17:46:12 2015 +0200
Make the change of tab size in TUI mode effective immediately
gdb/ChangeLog:
2015-01-16 Eli Zaretskii <eliz@gnu.org>
* tui/tui-win.c (tui_set_tab_width_command): Delete and
recreate the source and the disassembly windows, to show the
effect of the changed tab size immediately.
Diff:
---
gdb/ChangeLog | 3 +++
gdb/tui/tui-win.c | 22 +++++++++++++++++++++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ae82f49..661f9b6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -2,6 +2,9 @@
* tui/tui-win.c (tui_scroll_left_command, tui_scroll_right_command):
Doc fix.
+ (tui_set_tab_width_command): Delete and recreate the source and
+ the disassembly windows, to show the effect of the changed tab
+ size immediately.
* tui/tui-data.h (LINE_PREFIX): Make shorter
(MAX_PID_WIDTH): Enlarge from 14 to 19, to leave enough space for
diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index 0d155fb..96fa801 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -1002,7 +1002,27 @@ tui_set_tab_width_command (char *arg, int from_tty)
ts = atoi (arg);
if (ts > 0)
- tui_set_default_tab_len (ts);
+ {
+ tui_set_default_tab_len (ts);
+ /* We don't really change the height of any windows, but
+ calling these 2 functions causes a complete regeneration
+ and redisplay of the window's contents, which will take
+ the new tab width into account. */
+ if (tui_win_list[SRC_WIN]
+ && tui_win_list[SRC_WIN]->generic.is_visible)
+ {
+ make_invisible_and_set_new_height (TUI_SRC_WIN,
+ TUI_SRC_WIN->generic.height);
+ make_visible_with_new_height (TUI_SRC_WIN);
+ }
+ if (tui_win_list[DISASSEM_WIN]
+ && tui_win_list[DISASSEM_WIN]->generic.is_visible)
+ {
+ make_invisible_and_set_new_height (TUI_DISASM_WIN,
+ TUI_DISASM_WIN->generic.height);
+ make_visible_with_new_height (TUI_DISASM_WIN);
+ }
+ }
else
warning (_("Tab widths greater than 0 must be specified."));
}