diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-10 19:14:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-10 19:14:29 +0800 |
commit | b531e4ea337e4ed86913d59777c5b6b15059a719 (patch) | |
tree | 25a3fefe4d50f84fd93476bc2b7fd876ad816c03 /src/nvim/api/vim.c | |
parent | ff726cc569994aab61a42c40270e679dc80cca7c (diff) | |
parent | 381f8f86da4bf5b24fb993eac281dffd2a2bcd1e (diff) | |
download | rneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.tar.gz rneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.tar.bz2 rneovim-b531e4ea337e4ed86913d59777c5b6b15059a719.zip |
Merge pull request #18062 from zeertzjq/vim-8.2.4723
vim-patch:8.2.{4723,4728}: the ModeChanged autocmd event is inefficient
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 7c7ada55a2..503a1c9f23 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -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; |