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.
This commit is contained in:
Hannes Domani
2020-12-21 13:16:24 +01:00
parent b281a04ff0
commit b5ff370e96
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,11 @@
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.
2021-01-04 Mike Frysinger <vapier@gentoo.org> 2021-01-04 Mike Frysinger <vapier@gentoo.org>
* bfin-tdep.c (bfin_push_dummy_call): Use align_up. * bfin-tdep.c (bfin_push_dummy_call): Use align_up.

View File

@ -262,7 +262,7 @@ tui_source_window_base::refresh_window ()
scrolled beyond where we clip. */ scrolled beyond where we clip. */
m_horizontal_offset = pad_x; m_horizontal_offset = pad_x;
prefresh (m_pad.get (), 0, pad_x, y + 1, x + left_margin, 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 void
@ -273,7 +273,8 @@ tui_source_window_base::show_source_content ()
check_and_display_highlight_if_needed (); check_and_display_highlight_if_needed ();
int pad_width = std::max (m_max_length, width); 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)); m_pad.reset (newpad (m_content.size (), pad_width));
werase (m_pad.get ()); werase (m_pad.get ());