diff --git a/src/text_editor/window.cpp b/src/text_editor/window.cpp index c44507b..3794152 100644 --- a/src/text_editor/window.cpp +++ b/src/text_editor/window.cpp @@ -470,5 +470,8 @@ void MoveCursorByPageSize(Window *window, int direction, bool shift = false) { } } - SetStoredOffsetFromTop(window, is_on_screen_res); + IsOnScreenResult r = IsMainCaretOnScreen(window); + if (!r.caret_on_screen) { + SetStoredOffsetFromTop(window, is_on_screen_res); + } }