mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
vim-patch:8.2.4723: the ModeChanged autocmd event is inefficient
Problem: The ModeChanged autocmd event is inefficient.
Solution: Avoid allocating memory. (closes vim/vim#10134) Rename
trigger_modechanged() to may_trigger_modechanged().
2bf52dd065
Make v:event readonly for ModeChanged.
This commit is contained in:
@@ -1083,8 +1083,7 @@ int autocmd_register(int64_t id, event_T event, char_u *pat, int patlen, int gro
|
||||
|
||||
// need to initialize last_mode for the first ModeChanged autocmd
|
||||
if (event == EVENT_MODECHANGED && !has_event(EVENT_MODECHANGED)) {
|
||||
xfree(last_mode);
|
||||
last_mode = get_mode();
|
||||
get_mode(last_mode);
|
||||
}
|
||||
|
||||
// If the event is CursorMoved, update the last cursor position
|
||||
|
Reference in New Issue
Block a user