This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCHSET] [3/4] Fix various issue in TUI
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 06 Jan 2015 17:58:28 +0200
- Subject: Re: [PATCHSET] [3/4] Fix various issue in TUI
- Authentication-results: sourceware.org; auth=none
- References: <83wq57btea dot fsf at gnu dot org> <54AAE610 dot 4050700 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Mon, 05 Jan 2015 19:29:20 +0000
> From: Pedro Alves <palves@redhat.com>
>
> > @item tabset @var{nchars}
> > @kindex tabset
> > -Set the width of tab stops to be @var{nchars} characters.
> > +Set the width of tab stops to be @var{nchars} characters. This
> > +setting affects the display of TAB characters in the source and
> > +assembly windows.
> > @end table
>
> (this is yet another setting that would be nicer if the TUI reflected
> updates immediately.)
Like this?
2015-01-06 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.
--- gdb/tui/tui-win.c~2 2015-01-04 08:07:30 +0200
+++ gdb/tui/tui-win.c 2015-01-06 08:03:05 +0200
@@ -1020,7 +1026,27 @@ tui_set_tab_width_command (char *arg, in
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."));
}