aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-08-25 13:45:45 +0900
committererw7 <erw7.github@gmail.com>2019-09-04 13:40:04 +0900
commita2e48b556b7537acd26353b6cc201410be7cf3dc (patch)
tree8608753784910578b9772905f9545bf45c282361 /src/nvim/ex_getln.c
parent38806f23edfcba8cb7f7b80039d268ae3ffb0557 (diff)
downloadrneovim-a2e48b556b7537acd26353b6cc201410be7cf3dc.tar.gz
rneovim-a2e48b556b7537acd26353b6cc201410be7cf3dc.tar.bz2
rneovim-a2e48b556b7537acd26353b6cc201410be7cf3dc.zip
vim-patch:8.1.0362: cannot get the script line number when executing a function
Problem: Cannot get the script line number when executing a function. Solution: Store the line number besides the script ID. (Ozaki Kiichi, closes vim/vim#3362) Also display the line number with ":verbose set". https://github.com/vim/vim/commit/f29c1c6aa3f365c025890fab5fb9efbe88eb1761
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index f00367d9ca..6b4092b5b4 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1909,7 +1909,7 @@ static int command_line_changed(CommandLineState *s)
redrawcmdline();
s->did_incsearch = true;
} else if (s->firstc == ':'
- && current_SID == 0 // only if interactive
+ && current_sctx.sc_sid == 0 // only if interactive
&& *p_icm != NUL // 'inccommand' is set
&& curbuf->b_p_ma // buffer is modifiable
&& cmdline_star == 0 // not typing a password
@@ -5072,7 +5072,7 @@ static void * call_user_expand_func(user_expand_func_T user_expand_func,
char_u keep = 0;
typval_T args[4];
char_u *pat = NULL;
- int save_current_SID = current_SID;
+ const sctx_T save_current_sctx = current_sctx;
struct cmdline_info save_ccline;
if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL)
@@ -5098,14 +5098,15 @@ static void * call_user_expand_func(user_expand_func_T user_expand_func,
save_ccline = ccline;
ccline.cmdbuff = NULL;
ccline.cmdprompt = NULL;
- current_SID = xp->xp_scriptID;
+ current_sctx = xp->xp_script_ctx;
void *const ret = user_expand_func(xp->xp_arg, 3, args);
ccline = save_ccline;
- current_SID = save_current_SID;
- if (ccline.cmdbuff != NULL)
+ current_sctx = save_current_sctx;
+ if (ccline.cmdbuff != NULL) {
ccline.cmdbuff[ccline.cmdlen] = keep;
+ }
xfree(pat);
return ret;