diff --git a/src/text_editor/window.cpp b/src/text_editor/window.cpp index ff22fd5..c44507b 100644 --- a/src/text_editor/window.cpp +++ b/src/text_editor/window.cpp @@ -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.col = line_range.max - line_range.min; } xy.line += y;