[02/61] Check can_highlight in tui_check_and_display_highlight_if_needed

Message ID 20190704170311.15982-3-tom@tromey.com
State New
Headers show
Series
  • More TUI refactorings
Related show

Commit Message

Tom Tromey July 4, 2019, 5:02 p.m.
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.

2019-07-04  Tom Tromey  <tom@tromey.com>

	* tui/tui-wingeneral.c
	(tui_check_and_display_highlight_if_needed): Check can_highlight.
---
 gdb/ChangeLog            | 5 +++++
 gdb/tui/tui-wingeneral.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

-- 
2.17.2

Patch

diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index cf8d9fc3959..c15739c594b 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -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);