This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Check can_highlight in tui_check_and_display_highlight_if_needed
- From: Tom Tromey <tromey at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 17 Jul 2019 18:36:36 -0000
- Subject: [binutils-gdb] Check can_highlight in tui_check_and_display_highlight_if_needed
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=00e264e7626260a6df6b5a0aa7ee25215ea93f9c
commit 00e264e7626260a6df6b5a0aa7ee25215ea93f9c
Author: Tom Tromey <tom@tromey.com>
Date: Sun Jun 23 20:48:59 2019 -0600
Check can_highlight in tui_check_and_display_highlight_if_needed
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/tui/tui-wingeneral.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 28b0b53..0648d37 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index cf8d9fc..c15739c 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);