summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2a3d310ab6..fe3571b926 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1336,6 +1336,14 @@ main_loop(
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
}
+ // Ensure curwin->w_topline and curwin->w_leftcol are up to date
+ // before triggering a WinScrolled autocommand.
+ update_topline();
+ validate_cursor();
+
+ if (!finish_op)
+ may_trigger_winscrolled(curwin);
+
// If nothing is pending and we are going to wait for the user to
// type a character, trigger SafeState.
may_trigger_safestate(!op_pending() && restart_edit == 0);