summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-08 15:18:45 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-08 15:18:45 +0100
commit0937182d49fa8db50cec42785f22f1031760a0bd (patch)
treea41ab36fcbeb5b2f0bc91ce36b2d056af2ec2491 /src/main.c
parent18ee0f603ebd3c091f6d2ab88e652fda32821048 (diff)
patch 8.2.4713: plugins cannot track text scrollingv8.2.4713
Problem: Plugins cannot track text scrolling. Solution: Add the WinScrolled event. (closes #10102)
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);