From a2e48b556b7537acd26353b6cc201410be7cf3dc Mon Sep 17 00:00:00 2001 From: erw7 Date: Sun, 25 Aug 2019 13:45:45 +0900 Subject: 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 --- src/nvim/buffer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 382b4c45c1..f15205349b 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -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; } -- cgit From 9db60b06a1d9b50b3ba6beb858eb0fd2c58571c4 Mon Sep 17 00:00:00 2001 From: erw7 Date: Thu, 29 Aug 2019 13:07:03 +0900 Subject: vim-patch:8.1.0515: reloading a script gives errors for existing functions Problem: Reloading a script gives errors for existing functions. Solution: Allow redefining a function once when reloading a script. https://github.com/vim/vim/commit/ded5f1bed7ff2d138b3ee0f9610d17290b62692d --- src/nvim/buffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f15205349b..f8e07a471f 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -5155,6 +5155,7 @@ chk_modeline( const int secure_save = secure; const sctx_T save_current_sctx = current_sctx; current_sctx.sc_sid = SID_MODELINE; + current_sctx.sc_seq = 0; current_sctx.sc_lnum = 0; // Make sure no risky things are executed as a side effect. secure = 1; -- cgit