mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
fix(events): avoid unnecessary CursorMoved (#24675)
Problem: Temporarily changing current window in a script causes CursorMoved to be triggerd. Solution: Don't trigger CursorMoved if neither curwin nor cursor changed between two checks.
This commit is contained in:
@@ -80,6 +80,11 @@ typedef kvec_t(AutoCmd) AutoCmdVec;
|
||||
// apply_autocmds_group.
|
||||
EXTERN bool au_did_filetype INIT(= false);
|
||||
|
||||
/// For CursorMoved event
|
||||
EXTERN win_T *last_cursormoved_win INIT(= NULL);
|
||||
/// For CursorMoved event, only used when last_cursormoved_win == curwin
|
||||
EXTERN pos_T last_cursormoved INIT(= { 0, 0, 0 });
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "autocmd.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user