selection: auto-scroll: call cmd_scrollback_{up,down}() with number of rows

No need to loop and call cmd_scrollback_{up,down}() with ‘1’ each loop
iteration; just call it with the total number of lines to scroll.
This commit is contained in:
Daniel Eklöf 2020-10-11 18:26:24 +02:00
parent 0cff7c7c4f
commit 0d8344d3b9
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -818,14 +818,12 @@ fdm_scroll_timer(struct fdm *fdm, int fd, int events, void *data)
return true;
case SELECTION_SCROLL_UP:
for (uint64_t i = 0; i < expiration_count; i++)
cmd_scrollback_up(term, 1);
cmd_scrollback_up(term, expiration_count);
selection_update(term, term->selection.auto_scroll.col, 0);
break;
case SELECTION_SCROLL_DOWN:
for (uint64_t i = 0; i < expiration_count; i++)
cmd_scrollback_down(term, 1);
cmd_scrollback_down(term, expiration_count);
selection_update(term, term->selection.auto_scroll.col, term->rows - 1);
break;
}