From 8d430aa2ebfd1e44e5e7d78f2c1bdd93e42693d9 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Wed, 26 Apr 2023 00:37:27 +0200 Subject: core: fix display bug when drawing partially scrolled multiline If you have a chat line with multiple lines that were scrolled so that part of it is rendered at the bottom of the chat area, and part of it falls below the chat area, there was a bug where the prefix_suffix would be displayed at the end of the last line. Looks like this happens because the gui_chat_display_prefix_suffix is called for the line below the last line displayed in the chat area. So we have to add a check for this so we don't add the prefix_suffix. This check is copied from gui_chat_display_word which checks for the same. Fixes #1912 --- src/gui/curses/gui-curses-chat.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index d7dec68d8..915009d67 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -507,6 +507,9 @@ gui_chat_display_prefix_suffix (struct t_gui_window *window, chars_displayed = 0; + if ((!simulate) && (window->win_chat_cursor_y >= window->win_chat_height)) + return chars_displayed; + /* insert spaces for aligning text under time/nick */ length_align = gui_line_get_align (window->buffer, line, 0, 0); -- cgit v1.2.3