aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/normal.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-12 05:48:23 +0800
committerGitHub <noreply@github.com>2022-04-12 05:48:23 +0800
commitdbd5242d8e10db4ed077547755f0d84aa8261cb5 (patch)
tree507feed5fe2cbfd0e807719424aec1c472de2879 /src/nvim/normal.c
parent10b40440ddbdc979a47335790988966b4e9fb6f1 (diff)
parent6be4fd888c4972a411217e486037997720ece6be (diff)
downloadrneovim-dbd5242d8e10db4ed077547755f0d84aa8261cb5.tar.gz
rneovim-dbd5242d8e10db4ed077547755f0d84aa8261cb5.tar.bz2
rneovim-dbd5242d8e10db4ed077547755f0d84aa8261cb5.zip
Merge pull request #18075 from zeertzjq/vim-8.2.4713
vim-patch:8.2.4713: plugins cannot track text scrolling
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r--src/nvim/normal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index dcfd73a631..5b3f27529c 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -1223,10 +1223,9 @@ static void normal_check_interrupt(NormalState *s)
static void normal_check_window_scrolled(NormalState *s)
{
- // Trigger Scroll if the viewport changed.
- if (!finish_op && has_event(EVENT_WINSCROLLED)
- && win_did_scroll(curwin)) {
- do_autocmd_winscrolled(curwin);
+ if (!finish_op) {
+ // Trigger Scroll if the viewport changed.
+ may_trigger_winscrolled(curwin);
}
}
@@ -1353,9 +1352,10 @@ static int normal_check(VimState *state)
if (skip_redraw || exmode_active) {
skip_redraw = false;
} else if (do_redraw || stuff_empty()) {
- // Need to make sure w_topline and w_leftcol are correct before
- // normal_check_window_scrolled() is called.
+ // Ensure curwin->w_topline and curwin->w_leftcol are up to date
+ // before triggering a WinScrolled autocommand.
update_topline(curwin);
+ validate_cursor();
normal_check_cursor_moved(s);
normal_check_text_changed(s);