aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-winsource.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-10-19 07:45:05 -0600
committerTom Tromey <tromey@adacore.com>2020-10-19 13:45:24 -0600
commit22cc388e2b940608d4d759dc61c0335cfc621de1 (patch)
tree359e6288d162b0178a049f6158964b115bef62a8 /gdb/tui/tui-winsource.c
parent3c6eb4d439a31ec39d8c04f3b99d8a9f0bd607d2 (diff)
downloadgdb-22cc388e2b940608d4d759dc61c0335cfc621de1.zip
gdb-22cc388e2b940608d4d759dc61c0335cfc621de1.tar.gz
gdb-22cc388e2b940608d4d759dc61c0335cfc621de1.tar.bz2
Don't erase TUI source window when switching focus
PR tui/26719 points out that switching the focus can erase the TUI source window. This is a regression introduced by the patch to switch the source window to using a pad. This patch fixes the bug by arranging to call prefresh whenever the window is refreshed. 2020-10-19 Tom Tromey <tromey@adacore.com> PR tui/26719 * tui/tui-winsource.h (struct tui_source_window_base) <refresh_window>: Rename from refresh_pad. * tui/tui-winsource.c (tui_source_window_base::refresh_window): Rename from refresh_pad. (tui_source_window_base::show_source_content) (tui_source_window_base::do_scroll_horizontal): Update. gdb/testsuite/ChangeLog 2020-10-19 Tom Tromey <tromey@adacore.com> PR tui/26719 * gdb.tui/list.exp: Check source window contents after focus change.
Diffstat (limited to 'gdb/tui/tui-winsource.c')
-rw-r--r--gdb/tui/tui-winsource.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 30b8f69..957d931 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -250,8 +250,10 @@ tui_source_window_base::show_source_line (int lineno)
/* See tui-winsource.h. */
void
-tui_source_window_base::refresh_pad ()
+tui_source_window_base::refresh_window ()
{
+ tui_win_info::refresh_window ();
+
int pad_width = std::max (m_max_length, width);
int left_margin = 1 + TUI_EXECINFO_SIZE + extra_margin ();
int view_width = width - left_margin - 1;
@@ -278,8 +280,6 @@ tui_source_window_base::show_source_content ()
for (int lineno = 0; lineno < m_content.size (); lineno++)
show_source_line (lineno);
- refresh_pad ();
-
refresh_window ();
}
@@ -377,7 +377,7 @@ tui_source_window_base::do_scroll_horizontal (int num_to_scroll)
if (offset < 0)
offset = 0;
m_horizontal_offset = offset;
- refresh_pad ();
+ refresh_window ();
}
}