diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-20 22:00:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-20 22:00:13 +0800 |
commit | 565442ec421eeef0abe915d23ba481e8b75c6c38 (patch) | |
tree | 574d5e54be89621d57cbd0b23b2a64250522355f /src/nvim/autocmd.c | |
parent | 822eabc5e123bca71ba945467c3b01110bb0e003 (diff) | |
parent | d6bd9c77335e6a0b936e5b15f1b1df7e8af7cafd (diff) | |
download | rneovim-565442ec421eeef0abe915d23ba481e8b75c6c38.tar.gz rneovim-565442ec421eeef0abe915d23ba481e8b75c6c38.tar.bz2 rneovim-565442ec421eeef0abe915d23ba481e8b75c6c38.zip |
Merge pull request #21136 from zeertzjq/vim-9.0.0913
vim-patch:9.0.{partial:0913,0915}: only change in current window triggers the WinScrolled event
Diffstat (limited to 'src/nvim/autocmd.c')
-rw-r--r-- | src/nvim/autocmd.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/nvim/autocmd.c b/src/nvim/autocmd.c index 4df14411c5..54fa57c7a0 100644 --- a/src/nvim/autocmd.c +++ b/src/nvim/autocmd.c @@ -1142,13 +1142,17 @@ int autocmd_register(int64_t id, event_T event, char *pat, int patlen, int group } // Initialize the fields checked by the WinScrolled trigger to - // stop it from firing right after the first autocmd is defined. + // prevent it from firing right after the first autocmd is + // defined. if (event == EVENT_WINSCROLLED && !has_event(EVENT_WINSCROLLED)) { - curwin->w_last_topline = curwin->w_topline; - curwin->w_last_leftcol = curwin->w_leftcol; - curwin->w_last_skipcol = curwin->w_skipcol; - curwin->w_last_width = curwin->w_width; - curwin->w_last_height = curwin->w_height; + tabpage_T *save_curtab = curtab; + FOR_ALL_TABS(tp) { + unuse_tabpage(curtab); + use_tabpage(tp); + snapshot_windows_scroll_size(); + } + unuse_tabpage(curtab); + use_tabpage(save_curtab); } ap->cmds = NULL; |