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/eval/funcs.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/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index f7d9f76534..d365e075e6 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -6094,15 +6094,17 @@ static void f_mkdir(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "mode()" function static void f_mode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char *mode = get_mode(); + char buf[MODE_MAX_LENGTH]; + + get_mode(buf); // Clear out the minor mode when the argument is not a non-zero number or // non-empty string. if (!non_zero_arg(&argvars[0])) { - mode[1] = NUL; + buf[1] = NUL; } - rettv->vval.v_string = (char_u *)mode; + rettv->vval.v_string = vim_strsave((char_u *)buf); rettv->v_type = VAR_STRING; } |