diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-06-13 00:52:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-13 00:52:30 +0200 |
commit | 9c7132cda4cf35156397935ac00d1127f8920cdf (patch) | |
tree | 61801c2046b48a04562db93e7b19721134edabfd /src | |
parent | 12d8ff7ccdad4d5873347e8d318a47ac552941d7 (diff) | |
parent | cdbc733ec4302c6cc4269c99b725b32595a01c20 (diff) | |
download | rneovim-9c7132cda4cf35156397935ac00d1127f8920cdf.tar.gz rneovim-9c7132cda4cf35156397935ac00d1127f8920cdf.tar.bz2 rneovim-9c7132cda4cf35156397935ac00d1127f8920cdf.zip |
Merge pull request #14788 from shadmansaleh/fix/lua_runtime1
fixup(runtime): Fix lua runtime files not listed in :scriptnames
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/ex_cmds2.c | 17 | ||||
-rw-r--r-- | src/nvim/main.c | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c index 4798e93b91..9abeee47f4 100644 --- a/src/nvim/ex_cmds2.c +++ b/src/nvim/ex_cmds2.c @@ -2809,10 +2809,6 @@ int do_source(char_u *fname, int check_other, int is_vimrc) proftime_T wait_start; bool trigger_source_post = false; - if (path_with_extension((const char *)fname, "lua")) { - return (int)nlua_exec_file((const char *)fname); - } - p = expand_env_save(fname); if (p == NULL) { return retval; @@ -3005,10 +3001,15 @@ int do_source(char_u *fname, int check_other, int is_vimrc) firstline = p; } - // Call do_cmdline, which will call getsourceline() to get the lines. - do_cmdline(firstline, getsourceline, (void *)&cookie, - DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT); - retval = OK; + if (path_with_extension((const char *)fname, "lua")) { + // Source the file as lua + retval = (int)nlua_exec_file((const char *)fname); + } else { + // Call do_cmdline, which will call getsourceline() to get the lines. + do_cmdline(firstline, getsourceline, (void *)&cookie, + DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_REPEAT); + retval = OK; + } if (l_do_profiling == PROF_YES) { // Get "si" again, "script_items" may have been reallocated. diff --git a/src/nvim/main.c b/src/nvim/main.c index 53043d293e..7d7eba2105 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1811,7 +1811,7 @@ static bool do_user_initialization(void) char_u *init_lua_path = (char_u *)stdpaths_user_conf_subpath("init.lua"); if (os_path_exists(init_lua_path) - && nlua_exec_file((const char *)init_lua_path)) { + && do_source(init_lua_path, true, DOSO_VIMRC)) { os_setenv("MYVIMRC", (const char *)init_lua_path, 1); char_u *vimrc_path = (char_u *)stdpaths_user_conf_subpath("init.vim"); |