aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-17 15:14:01 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-17 15:46:24 +0800
commit0c99ae7a88216f32ad188fc67ed00387c6ce2cae (patch)
tree225fcf39f68c0e2487aa74ec74a5c263fafb793c
parentd6e0f3dad2176b2619ea3ca2a8f622c00d4f78af (diff)
downloadrneovim-0c99ae7a88216f32ad188fc67ed00387c6ce2cae.tar.gz
rneovim-0c99ae7a88216f32ad188fc67ed00387c6ce2cae.tar.bz2
rneovim-0c99ae7a88216f32ad188fc67ed00387c6ce2cae.zip
vim-patch:8.2.4180: 'balloonexpr' is evaluated in the current script context
Problem: 'balloonexpr' is evaluated in the current script context. Solution: Use the script context where the option was set. https://github.com/vim/vim/commit/5600a709f453045c80f92087acc0f855b4af377a Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r--src/nvim/option.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 6d4e7de1a3..3b674ce726 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -1913,6 +1913,18 @@ bool parse_winhl_opt(win_T *wp)
return true;
}
+/// Get the script context of global option "name".
+sctx_T *get_option_sctx(const char *const name)
+{
+ int idx = findoption(name);
+
+ if (idx >= 0) {
+ return &options[idx].last_set.script_ctx;
+ }
+ siemsg("no such option: %s", name);
+ return NULL;
+}
+
/// Set the script_ctx for an option, taking care of setting the buffer- or
/// window-local value.
void set_option_sctx_idx(int opt_idx, int opt_flags, sctx_T script_ctx)