1
0
Fork 0

fix recount of lines after scroll

This commit is contained in:
Ailin Nemui 2022-06-13 08:59:27 +02:00
parent 48edd6f5fa
commit b028b8e19d
1 changed files with 9 additions and 5 deletions

View File

@ -1023,13 +1023,17 @@ void textbuffer_view_clear(TEXT_BUFFER_VIEW_REC *view)
/* Scroll the view up/down */
void textbuffer_view_scroll(TEXT_BUFFER_VIEW_REC *view, int lines)
{
int count;
int count, ypos;
g_return_if_fail(view != NULL);
g_return_if_fail(view != NULL);
count = view_scroll(view, &view->startline, &view->subline, lines, TRUE);
ypos = view->ypos + (lines < 0 ? count : -count);
textbuffer_view_init_ypos(view);
if (ypos != view->ypos)
textbuffer_view_resize(view, view->width, view->height);
count = view_scroll(view, &view->startline, &view->subline,
lines, TRUE);
view->ypos += lines < 0 ? count : -count;
view->bottom = view_is_bottom(view);
if (view->bottom) view->more_text = FALSE;