core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (closes #899, issue #978)

v2.8-utf8proc
Sébastien Helleu 2019-10-14 20:44:15 +02:00
parent 7e6d933d74
commit 5d4220a91f
2 changed files with 14 additions and 2 deletions

View File

@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
New features::
* core: fix scrolling up in bare mode when switched to bare mode at the top of the buffer (issue #899, issue #978)
* core: add file weechat.desktop
* core: add reverse of string for screen in evaluation of expressions with "revscr:"
* core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx"

View File

@ -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));
}
/*