summaryrefslogtreecommitdiff
path: root/src/gui/curses/gui-curses-chat.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-10-14 20:44:15 +0200
committerSébastien Helleu <flashcode@flashtux.org>2019-10-14 20:44:15 +0200
commit5d4220a91f8aa1467302dac2e7a4bfdb7a017009 (patch)
tree1b1537a8d6ef8c5e4935af4f8f76f927fb62b477 /src/gui/curses/gui-curses-chat.c
parent7e6d933d74e0540a5dc466e3da04e38f1c1ada8e (diff)
downloadweechat-5d4220a91f8aa1467302dac2e7a4bfdb7a017009.zip
core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (closes #899, issue #978)
Diffstat (limited to 'src/gui/curses/gui-curses-chat.c')
-rw-r--r--src/gui/curses/gui-curses-chat.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 2904ecd32..024fae90a 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -2055,8 +2055,17 @@ gui_chat_draw_bare (struct t_gui_window *window)
{
/* display from top to bottom (starting with "start_line") */
y = 0;
- ptr_line = (window->scroll->start_line) ?
- window->scroll->start_line : gui_line_get_first_displayed (window->buffer);
+ if (window->scroll->start_line)
+ {
+ ptr_line = window->scroll->start_line;
+ window->scroll->first_line_displayed =
+ (ptr_line == gui_line_get_first_displayed (window->buffer));
+ }
+ else
+ {
+ ptr_line = gui_line_get_first_displayed (window->buffer);
+ window->scroll->first_line_displayed = 1;
+ }
while (ptr_line && (y < gui_term_lines))
{
line = gui_chat_get_bare_line (ptr_line);
@@ -2093,6 +2102,8 @@ gui_chat_draw_bare (struct t_gui_window *window)
free (line);
ptr_line = gui_line_get_prev_displayed (ptr_line);
}
+ window->scroll->first_line_displayed =
+ (ptr_line == gui_line_get_first_displayed (window->buffer));
}
/*