Consolidate setting of current_layout
authorTom Tromey <tom@tromey.com>
Wed, 9 Oct 2019 02:06:09 +0000 (20:06 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 12 Nov 2019 19:29:15 +0000 (12:29 -0700)
Currently several functions in tui-layout.c set current_layout after
their work is done.  This moves this assignment to show_layout,
instead.

gdb/ChangeLog
2019-11-12  Tom Tromey  <tom@tromey.com>

* tui/tui-layout.c (show_layout): Set current_layout.
(show_source_disasm_command, show_data)
(show_source_or_disasm_and_command): Don't set current_layout.

Change-Id: Id8b23797d68e607f0fcd6d29b8801869d40d1869

gdb/ChangeLog
gdb/tui/tui-layout.c

index f1a05e276db2d433eeb3ca0c43a0b992e0ccc9a3..23095e0200fce081c33d9ec85730b7d5b7c58b85 100644 (file)
@@ -1,3 +1,9 @@
+2019-11-12  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-layout.c (show_layout): Set current_layout.
+       (show_source_disasm_command, show_data)
+       (show_source_or_disasm_and_command): Don't set current_layout.
+
 2019-11-12  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-layout.c (_initialize_tui_layout): Move to end.
index c7f6545b3ecb3bee5b80f2cf3ef2296b0d6c3739..ba0b367e16dee79230ece248db90521c9798cf7a 100644 (file)
@@ -91,6 +91,7 @@ show_layout (enum tui_layout_type layout)
          break;
        }
 
+      current_layout = layout;
       tui_delete_invisible_windows ();
     }
 }
@@ -418,7 +419,6 @@ show_source_disasm_command (void)
                       tui_term_width (),
                       0,
                       tui_term_height () - cmd_height);
-  current_layout = SRC_DISASSEM_COMMAND;
 }
 
 
@@ -461,8 +461,6 @@ show_data (enum tui_layout_type new_layout)
                   0, total_height - 1);
   TUI_CMD_WIN->resize (TUI_CMD_WIN->height, tui_term_width (),
                       0, total_height);
-
-  current_layout = new_layout;
 }
 
 void
@@ -541,7 +539,6 @@ show_source_or_disasm_and_command (enum tui_layout_type layout_type)
                       tui_term_width (),
                       0,
                       src_height);
-  current_layout = layout_type;
 }
 
 \f
This page took 0.031078 seconds and 4 git commands to generate.