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).
This commit is contained in:
Benno Schulenberg
2026-02-07 16:48:20 +01:00
parent 965531485f
commit a8dca7c918

View File

@@ -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;
}