aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-12-02 21:00:27 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-12-03 03:39:56 +0800
commit70ac0c9358251bf54f29a30a369880d94680ace7 (patch)
tree894b96de2f83a0394f30ef45591f185601c71ad0 /src/nvim/option.c
parent07e6296520fc83b1fdb287b5173494cdd0e9136f (diff)
downloadrneovim-70ac0c9358251bf54f29a30a369880d94680ace7.tar.gz
rneovim-70ac0c9358251bf54f29a30a369880d94680ace7.tar.bz2
rneovim-70ac0c9358251bf54f29a30a369880d94680ace7.zip
vim-patch:8.2.3889: duplicate code for translating script-local function name
Problem: Duplicate code for translating script-local function name. Solution: Move the code to get_scriptlocal_funcname(). (Yegappan Lakshmanan, closes vim/vim#9393) https://github.com/vim/vim/commit/e7f4abd38b6e05100c699900c8f87281e363beb2 Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 6d461d9b9d..e67bacce61 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -5170,26 +5170,7 @@ int option_set_callback_func(char *optval, Callback *optcb)
// treat everything else as a function name string
tv = xcalloc(1, sizeof(*tv));
tv->v_type = VAR_STRING;
-
- // Function name starting with "s:" are supported only in a vimscript
- // context.
- if (strncmp(optval, "s:", 2) == 0) {
- char sid_buf[25];
-
- if (!SCRIPT_ID_VALID(current_sctx.sc_sid)) {
- emsg(_(e_usingsid));
- return FAIL;
- }
- // Expand s: prefix into <SNR>nr_<name>
- snprintf(sid_buf, sizeof(sid_buf), "<SNR>%" PRId64 "_",
- (int64_t)current_sctx.sc_sid);
- char *funcname = xmalloc(strlen(sid_buf) + strlen(optval + 2) + 1);
- STRCPY(funcname, sid_buf);
- STRCAT(funcname, optval + 2);
- tv->vval.v_string = funcname;
- } else {
- tv->vval.v_string = xstrdup(optval);
- }
+ tv->vval.v_string = xstrdup(optval);
}
Callback cb;