Check can_highlight in tui_check_and_display_highlight_if_needed
authorTom Tromey <tom@tromey.com>
Mon, 24 Jun 2019 02:48:59 +0000 (20:48 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 17 Jul 2019 18:18:51 +0000 (12:18 -0600)
tui_check_and_display_highlight_if_needed currently checks the
window's type; but this can be replaced with a check of
"can_highlight", making it more polymorphically-correct.

gdb/ChangeLog
2019-07-17  Tom Tromey  <tom@tromey.com>

* tui/tui-wingeneral.c
(tui_check_and_display_highlight_if_needed): Check can_highlight.

gdb/ChangeLog
gdb/tui/tui-wingeneral.c

index 28b0b53..0648d37 100644 (file)
@@ -1,5 +1,10 @@
 2019-07-17  Tom Tromey  <tom@tromey.com>
 
+       * tui/tui-wingeneral.c
+       (tui_check_and_display_highlight_if_needed): Check can_highlight.
+
+2019-07-17  Tom Tromey  <tom@tromey.com>
+
        * tui/tui-data.h (struct tui_win_info) <can_scroll>: New method.
        (struct tui_cmd_window) <can_scroll>: New method.
        * tui/tui-command.c (tui_dispatch_ctrl_char): Use can_scroll
index cf8d9fc..c15739c 100644 (file)
@@ -128,7 +128,7 @@ tui_highlight_win (struct tui_win_info *win_info)
 void
 tui_check_and_display_highlight_if_needed (struct tui_win_info *win_info)
 {
-  if (win_info != NULL && win_info->type != CMD_WIN)
+  if (win_info != NULL && win_info->can_highlight)
     {
       if (win_info->is_highlighted)
        tui_highlight_win (win_info);