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/main.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/nvim/main.c') diff --git a/src/nvim/main.c b/src/nvim/main.c index e7c45b1a7b..9ea856a0c4 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1638,11 +1638,12 @@ static void exe_pre_commands(mparm_T *parmp) if (cnt > 0) { curwin->w_cursor.lnum = 0; /* just in case.. */ sourcing_name = (char_u *)_("pre-vimrc command line"); - current_SID = SID_CMDARG; - for (i = 0; i < cnt; ++i) + current_sctx.sc_sid = SID_CMDARG; + for (i = 0; i < cnt; i++) { do_cmdline_cmd(cmds[i]); + } sourcing_name = NULL; - current_SID = 0; + current_sctx.sc_sid = 0; TIME_MSG("--cmd commands"); } } @@ -1663,16 +1664,17 @@ static void exe_commands(mparm_T *parmp) if (parmp->tagname == NULL && curwin->w_cursor.lnum <= 1) curwin->w_cursor.lnum = 0; sourcing_name = (char_u *)"command line"; - current_SID = SID_CARG; - for (i = 0; i < parmp->n_commands; ++i) { + current_sctx.sc_sid = SID_CARG; + for (i = 0; i < parmp->n_commands; i++) { do_cmdline_cmd(parmp->commands[i]); if (parmp->cmds_tofree[i]) xfree(parmp->commands[i]); } sourcing_name = NULL; - current_SID = 0; - if (curwin->w_cursor.lnum == 0) + current_sctx.sc_sid = 0; + if (curwin->w_cursor.lnum == 0) { curwin->w_cursor.lnum = 1; + } if (!exmode_active) msg_scroll = FALSE; @@ -1858,12 +1860,13 @@ static int execute_env(char *env) linenr_T save_sourcing_lnum = sourcing_lnum; sourcing_name = (char_u *)env; sourcing_lnum = 0; - scid_T save_sid = current_SID; - current_SID = SID_ENV; + const sctx_T save_current_sctx = current_sctx; + current_sctx.sc_sid = SID_ENV; + current_sctx.sc_lnum = 0; do_cmdline_cmd((char *)initstr); sourcing_name = save_sourcing_name; sourcing_lnum = save_sourcing_lnum; - current_SID = save_sid; + current_sctx = save_current_sctx; return OK; } return FAIL; -- 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/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/main.c') diff --git a/src/nvim/main.c b/src/nvim/main.c index 9ea856a0c4..50e495c1e6 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1665,6 +1665,7 @@ static void exe_commands(mparm_T *parmp) curwin->w_cursor.lnum = 0; sourcing_name = (char_u *)"command line"; current_sctx.sc_sid = SID_CARG; + current_sctx.sc_seq = 0; for (i = 0; i < parmp->n_commands; i++) { do_cmdline_cmd(parmp->commands[i]); if (parmp->cmds_tofree[i]) @@ -1862,6 +1863,7 @@ static int execute_env(char *env) sourcing_lnum = 0; const sctx_T save_current_sctx = current_sctx; current_sctx.sc_sid = SID_ENV; + current_sctx.sc_seq = 0; current_sctx.sc_lnum = 0; do_cmdline_cmd((char *)initstr); sourcing_name = save_sourcing_name; -- cgit