diff options
author | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-03 07:07:51 +0600 |
---|---|---|
committer | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-11 01:01:03 +0600 |
commit | e1edc079dd0d0cb4a53e5998086568cf9d10a26a (patch) | |
tree | eb60874111545e69847809a765c8dc6921e37aa2 /src/nvim/runtime.c | |
parent | 92b6b3764cf75d01bcbf04fcf598140fc01e7902 (diff) | |
download | rneovim-e1edc079dd0d0cb4a53e5998086568cf9d10a26a.tar.gz rneovim-e1edc079dd0d0cb4a53e5998086568cf9d10a26a.tar.bz2 rneovim-e1edc079dd0d0cb4a53e5998086568cf9d10a26a.zip |
refactor(source): Move lua file detection to do_source
So now :source can run lua files too :)
* feat: Add support for :[ranged]source for lua files
Diffstat (limited to 'src/nvim/runtime.c')
-rw-r--r-- | src/nvim/runtime.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 22df4d985b..c3cd210538 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -15,7 +15,6 @@ #include "nvim/misc1.h" #include "nvim/os/os.h" #include "nvim/runtime.h" -#include "nvim/lua/executor.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "runtime.c.generated.h" @@ -50,11 +49,7 @@ void ex_runtime(exarg_T *eap) static void source_callback(char_u *fname, void *cookie) { - if (path_with_extension((const char *)fname, "lua")) { - nlua_exec_file((const char *)fname); - } else { - (void)do_source(fname, false, DOSO_NONE); - } + (void)do_source(fname, false, DOSO_NONE); } /// Find the file "name" in all directories in "path" and invoke @@ -259,11 +254,7 @@ static void source_all_matches(char_u *pat) if (gen_expand_wildcards(1, &pat, &num_files, &files, EW_FILE) == OK) { for (int i = 0; i < num_files; i++) { - if (path_with_extension((const char *)files[i], "lua")) { - nlua_exec_file((const char *)files[i]); - } else { - (void)do_source(files[i], false, DOSO_NONE); - } + (void)do_source(files[i], false, DOSO_NONE); } FreeWild(num_files, files); } |