diff options
author | shadmansaleh <shadmansaleh3@gmail.com> | 2021-05-31 17:35:13 +0600 |
---|---|---|
committer | shadmansaleh <shadmansaleh3@gmail.com> | 2021-06-11 00:58:38 +0600 |
commit | 687eb0b39f3bcad9566198b4c60bbd2755032991 (patch) | |
tree | d118e6d1adc4e9fdff845912e1606ab40ae8b454 /src/nvim/main.c | |
parent | 1df8a34a7b91028413d6ac751b9dbf9fdcd6cda2 (diff) | |
download | rneovim-687eb0b39f3bcad9566198b4c60bbd2755032991.tar.gz rneovim-687eb0b39f3bcad9566198b4c60bbd2755032991.tar.bz2 rneovim-687eb0b39f3bcad9566198b4c60bbd2755032991.zip |
feat(startup): Source runtime/plugin/**/*.lua at startup
For opt plugins these files are sourced on `:packadd`
* `:runtime` Now can exexute lua files
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 56cd97f133..e626ad03db 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -1367,7 +1367,8 @@ static void load_plugins(void) { if (p_lpl) { char_u *rtp_copy = NULL; - char_u *const plugin_pattern = (char_u *)"plugin/**/*.vim"; // NOLINT + char_u *const plugin_pattern_vim = (char_u *)"plugin/**/*.vim"; // NOLINT + char_u *const plugin_pattern_lua = (char_u *)"plugin/**/*.lua"; // NOLINT // First add all package directories to 'runtimepath', so that their // autoload directories can be found. Only if not done already with a @@ -1380,7 +1381,10 @@ static void load_plugins(void) } source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy, - plugin_pattern, + plugin_pattern_vim, + DIP_ALL | DIP_NOAFTER); + source_in_path(rtp_copy == NULL ? p_rtp : rtp_copy, + plugin_pattern_lua, DIP_ALL | DIP_NOAFTER); TIME_MSG("loading plugins"); xfree(rtp_copy); @@ -1392,7 +1396,8 @@ static void load_plugins(void) } TIME_MSG("loading packages"); - source_runtime(plugin_pattern, DIP_ALL | DIP_AFTER); + source_runtime(plugin_pattern_vim, DIP_ALL | DIP_AFTER); + source_runtime(plugin_pattern_lua, DIP_ALL | DIP_AFTER); TIME_MSG("loading after plugins"); } } |