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:
@@ -361,9 +361,10 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, linenr_T
|
||||
}
|
||||
|
||||
// when the cursor line is changed always trigger CursorMoved
|
||||
if (lnum <= curwin->w_cursor.lnum
|
||||
if (last_cursormoved_win == curwin
|
||||
&& lnum <= curwin->w_cursor.lnum
|
||||
&& lnume + (xtra < 0 ? -xtra : xtra) > curwin->w_cursor.lnum) {
|
||||
curwin->w_last_cursormoved.lnum = 0;
|
||||
last_cursormoved.lnum = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user