diff options
author | Tom Tromey <tom@tromey.com> | 2019-06-23 20:39:57 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-07-17 12:18:51 -0600 |
commit | 06210ce428ad74c28fd94f7ea3800b79791cdefa (patch) | |
tree | feb0e94f60bb2db4caf20296412cb0e9bf3eaee8 /gdb/tui/tui-command.c | |
parent | 381befeedf9316991d47f4213850545a96593d23 (diff) | |
download | fsf-binutils-gdb-06210ce428ad74c28fd94f7ea3800b79791cdefa.zip fsf-binutils-gdb-06210ce428ad74c28fd94f7ea3800b79791cdefa.tar.gz fsf-binutils-gdb-06210ce428ad74c28fd94f7ea3800b79791cdefa.tar.bz2 |
Introduce can_scroll method
This introduces a "can_scroll" method, removing a spot that explicitly
checks a window's type.
gdb/ChangeLog
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
method.
Diffstat (limited to 'gdb/tui/tui-command.c')
-rw-r--r-- | gdb/tui/tui-command.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gdb/tui/tui-command.c b/gdb/tui/tui-command.c index 259620f..bd16f80 100644 --- a/gdb/tui/tui-command.c +++ b/gdb/tui/tui-command.c @@ -48,10 +48,9 @@ tui_dispatch_ctrl_char (unsigned int ch) if (ch == '\f') tui_refresh_all_win (); - /* If the command window has the logical focus, or no-one does - assume it is the command window; in this case, pass the character - on through and do nothing here. */ - if (win_info == NULL || win_info == TUI_CMD_WIN) + /* If no window has the focus, or if the focus window can't scroll, + just pass the character through. */ + if (win_info == NULL || !win_info->can_scroll ()) return ch; switch (ch) |