aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/lua/executor.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-06-23 20:34:57 +0200
committerGitHub <noreply@github.com>2021-06-23 20:34:57 +0200
commit24e0c16fd6cb33a399772330cb80dfa4c1306284 (patch)
tree01f7f2c30dd159bc03b5ebc8ae9ed8b2b7d1c61e /src/nvim/lua/executor.c
parent0d7e33bc1307117127e519fb12ec491a1a1ebd82 (diff)
parentb4ac8780267d9164a84deaec27fbc6260f765514 (diff)
downloadrneovim-24e0c16fd6cb33a399772330cb80dfa4c1306284.tar.gz
rneovim-24e0c16fd6cb33a399772330cb80dfa4c1306284.tar.bz2
rneovim-24e0c16fd6cb33a399772330cb80dfa4c1306284.zip
Merge pull request #14868 from shadmansaleh/patch_verbose_for_lua
fix(runtime): Fix bugs regarding lua runtime files
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r--src/nvim/lua/executor.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index afc387ef38..4d4286354b 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -1164,6 +1164,13 @@ static void nlua_typval_exec(const char *lcmd, size_t lcmd_len,
int nlua_source_using_linegetter(LineGetter fgetline,
void *cookie, char *name)
{
+ const linenr_T save_sourcing_lnum = sourcing_lnum;
+ const sctx_T save_current_sctx = current_sctx;
+ current_sctx.sc_sid = SID_STR;
+ current_sctx.sc_seq = 0;
+ current_sctx.sc_lnum = 0;
+ sourcing_lnum = 0;
+
garray_T ga;
char_u *line = NULL;
@@ -1174,6 +1181,9 @@ int nlua_source_using_linegetter(LineGetter fgetline,
char *code = (char *)ga_concat_strings_sep(&ga, "\n");
size_t len = strlen(code);
nlua_typval_exec(code, len, name, NULL, 0, false, NULL);
+
+ sourcing_lnum = save_sourcing_lnum;
+ current_sctx = save_current_sctx;
ga_clear_strings(&ga);
xfree(code);
return OK;