From 2ae0d32a72c3ee207b6f9cd48c4beffa6e7c774f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 3 Dec 2022 08:24:22 +0800 Subject: refactor: make sure getting a callback doesn't modify argument --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6d8f4d092c..fdb379a682 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -5511,7 +5511,7 @@ void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv, bool retlist } /// Get a callback from "arg". It can be a Funcref or a function name. -bool callback_from_typval(Callback *const callback, typval_T *const arg) +bool callback_from_typval(Callback *const callback, const typval_T *const arg) FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT { int r = OK; -- cgit From 9671908c682dc3fc4e939f44a636457db6f3e5a4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 3 Dec 2022 08:17:38 +0800 Subject: vim-patch:8.2.3900: it is not easy to use a script-local function for an option Problem: It is not easy to use a script-local function for an option. Solution: recognize s: and at the start of the expression. (Yegappan Lakshmanan, closes vim/vim#9401) https://github.com/vim/vim/commit/8bb65f230d3025037f34021a72616038da0601ee Omit duplicate docs in fold.txt: removed in a later runtime update. Cherry-pick test_diffmode.vim changes from patch 8.2.1432. Co-authored-by: Yegappan Lakshmanan --- src/nvim/eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index fdb379a682..554771d9c9 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -711,7 +711,7 @@ void eval_patch(const char *const origfile, const char *const difffile, const ch set_vim_var_string(VV_FNAME_IN, origfile, -1); set_vim_var_string(VV_FNAME_DIFF, difffile, -1); set_vim_var_string(VV_FNAME_OUT, outfile, -1); - (void)eval_to_bool((char *)p_pex, &err, NULL, false); + (void)eval_to_bool(p_pex, &err, NULL, false); set_vim_var_string(VV_FNAME_IN, NULL, -1); set_vim_var_string(VV_FNAME_DIFF, NULL, -1); set_vim_var_string(VV_FNAME_OUT, NULL, -1); -- cgit