mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +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:
@@ -1549,10 +1549,11 @@ Dictionary nvim_get_mode(void)
|
||||
FUNC_API_SINCE(2) FUNC_API_FAST
|
||||
{
|
||||
Dictionary rv = ARRAY_DICT_INIT;
|
||||
char *modestr = get_mode();
|
||||
char modestr[MODE_MAX_LENGTH];
|
||||
get_mode(modestr);
|
||||
bool blocked = input_blocking();
|
||||
|
||||
PUT(rv, "mode", STRING_OBJ(cstr_as_string(modestr)));
|
||||
PUT(rv, "mode", STRING_OBJ(cstr_to_string(modestr)));
|
||||
PUT(rv, "blocking", BOOLEAN_OBJ(blocked));
|
||||
|
||||
return rv;
|
||||
|
Reference in New Issue
Block a user