From a8dca7c918ae92cd706cc66ec11380c4b44b4d01 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sat, 7 Feb 2026 16:48:20 +0100 Subject: [PATCH] display: let option --jumpyscrolling affect also sideways scrolling When using --jumpy, the viewport scrolls vertically in steps of half a screen (height). Then it makes sense that the viewport also scrolls horizontally in steps of half a screen (width). --- src/utils.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils.c b/src/utils.c index 191bf23a..4e251cb5 100644 --- a/src/utils.c +++ b/src/utils.c @@ -347,9 +347,13 @@ size_t get_page_start(size_t column) if (column < CUSHION) return 0; else if (column < openfile->brink + CUSHION) - return column - CUSHION; + { if (ISSET(JUMPY_SCROLLING)) + return (column > editwincols / 2) ? column - editwincols / 2 : 0; + else + return column - CUSHION; + } else if (column > openfile->brink + editwincols - CUSHION - 1) - return column - editwincols + CUSHION + 1; + return column - editwincols + (ISSET(JUMPY_SCROLLING) ? editwincols / 2 : CUSHION) + 1; else return openfile->brink; }