mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
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".
f29c1c6aa3
This commit is contained in:
@@ -5066,7 +5066,6 @@ chk_modeline(
|
||||
int retval = OK;
|
||||
char_u *save_sourcing_name;
|
||||
linenr_T save_sourcing_lnum;
|
||||
scid_T save_SID;
|
||||
|
||||
prev = -1;
|
||||
for (s = ml_get(lnum); *s != NUL; s++) {
|
||||
@@ -5154,15 +5153,16 @@ chk_modeline(
|
||||
|
||||
if (*s != NUL) { // skip over an empty "::"
|
||||
const int secure_save = secure;
|
||||
save_SID = current_SID;
|
||||
current_SID = SID_MODELINE;
|
||||
const sctx_T save_current_sctx = current_sctx;
|
||||
current_sctx.sc_sid = SID_MODELINE;
|
||||
current_sctx.sc_lnum = 0;
|
||||
// Make sure no risky things are executed as a side effect.
|
||||
secure = 1;
|
||||
|
||||
retval = do_set(s, OPT_MODELINE | OPT_LOCAL | flags);
|
||||
|
||||
secure = secure_save;
|
||||
current_SID = save_SID;
|
||||
current_sctx = save_current_sctx;
|
||||
if (retval == FAIL) { // stop if error found
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user