aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorHannes Domani <ssbssa@yahoo.de>2020-12-21 13:16:24 +0100
committerHannes Domani <ssbssa@yahoo.de>2021-01-05 14:08:26 +0100
commitb5ff370e964a5a794a6b5791ca55ac103ebffe70 (patch)
tree60efadcd9c0663eec43901bbf5174b08cd8b61b3 /gdb/tui
parentb281a04ff0a40440c7a2a0ab75ac0410cc1f53e8 (diff)
downloadgdb-b5ff370e964a5a794a6b5791ca55ac103ebffe70.zip
gdb-b5ff370e964a5a794a6b5791ca55ac103ebffe70.tar.gz
gdb-b5ff370e964a5a794a6b5791ca55ac103ebffe70.tar.bz2
Fix TUI source window drawing
The smaxrow and smaxcol parameters of prefresh are the bottom right corner of the text area inclusive, not exclusive. And if the source window grows bigger in height, the pad has to grow as well. gdb/ChangeLog: 2021-01-05 Hannes Domani <ssbssa@yahoo.de> PR tui/26927 * tui/tui-winsource.c (tui_source_window_base::refresh_window): Fix source pad size in prefresh. (tui_source_window_base::show_source_content): Grow source pad if necessary.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-winsource.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index adbd277..55b66e1 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -262,7 +262,7 @@ tui_source_window_base::refresh_window ()
scrolled beyond where we clip. */
m_horizontal_offset = pad_x;
prefresh (m_pad.get (), 0, pad_x, y + 1, x + left_margin,
- y + 1 + m_content.size (), x + left_margin + view_width - 1);
+ y + m_content.size (), x + left_margin + view_width - 1);
}
void
@@ -273,7 +273,8 @@ tui_source_window_base::show_source_content ()
check_and_display_highlight_if_needed ();
int pad_width = std::max (m_max_length, width);
- if (m_pad == nullptr || pad_width > getmaxx (m_pad.get ()))
+ if (m_pad == nullptr || pad_width > getmaxx (m_pad.get ())
+ || m_content.size () > getmaxy (m_pad.get ()))
m_pad.reset (newpad (m_content.size (), pad_width));
werase (m_pad.get ());