PageDown, PageUp is setting cursor position to beginning of line now

This commit is contained in:
Krzosa Karol
2026-01-30 21:43:01 +01:00
parent 2d1edd800a
commit c9acc31cfc

View File

@@ -453,13 +453,12 @@ void MoveCursorByPageSize(Window *window, int direction, bool shift = false) {
y = -y;
}
For(set.view->carets) {
For (set.view->carets) {
XY xy = PosToXY(set.buffer, GetFront(it));
xy.col = 0;
if (direction == DIR_DOWN && xy.line == set.buffer->line_starts.len - 1) {
Range line_range = GetLineRange(set.buffer, xy.line);
xy.col = line_range.max - line_range.min;
} else if (direction == DIR_UP && xy.line == 0) {
xy.col = 0;
}
xy.line += y;