From 0d8344d3b904c3ae4c18f6bffb9ef7b05c8361e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 11 Oct 2020 18:26:24 +0200 Subject: [PATCH] selection: auto-scroll: call cmd_scrollback_{up,down}() with number of rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- selection.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/selection.c b/selection.c index 54a50ff4..2d40b38b 100644 --- a/selection.c +++ b/selection.c @@ -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; }