This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCHSET] [3/4] Fix various issue in TUI


> 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."));
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]