Make the change of tab size in TUI mode effective immediately
authorEli Zaretskii <eliz@gnu.org>
Fri, 16 Jan 2015 15:46:12 +0000 (17:46 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 16 Jan 2015 15:46:12 +0000 (17:46 +0200)
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.

gdb/ChangeLog
gdb/tui/tui-win.c

index ae82f498a865141e715cc85bb3623e0a513f82cd..661f9b63e3b29c83ce89a3b7f2d1119e4e6668a0 100644 (file)
@@ -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
index 0d155fbd2ca1aa2de5a28fa5d6651d7c3a21dd65..96fa8012c82bd43b231cb17803706348ddbafebd 100644 (file)
@@ -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."));
     }