aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-11-18 20:02:44 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2020-11-19 14:31:07 +0100
commita119fe15da28b166ffef6bf34067e5a7f75bbca9 (patch)
treedfbaad7525ebd9cb6e8ca9317efa2ce09d4e9a2a /src/nvim/ex_getln.c
parent569e5c86bfd7e7729229030fc2045c624e5f33c4 (diff)
downloadrneovim-a119fe15da28b166ffef6bf34067e5a7f75bbca9.tar.gz
rneovim-a119fe15da28b166ffef6bf34067e5a7f75bbca9.tar.bz2
rneovim-a119fe15da28b166ffef6bf34067e5a7f75bbca9.zip
startup: load files from &packpath . '/start/{pluginname}'
Quoting the existing docs: Packages are loaded. These are plugins, as above [&runtimepath], but found in the "start" directory of each entry in 'packpath'. Every plugin directory found is added in 'runtimepath' and then the plugins are sourced. Also tj didn't think I could do it.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 9edb826ea6..0100be15bc 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -5533,6 +5533,7 @@ static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file,
garray_T ga;
ga_init(&ga, (int)sizeof(char *), 10);
+ // TODO(bfredl): this is bullshit, exandpath should not reinvent path logic.
for (int i = 0; dirnames[i] != NULL; i++) {
size_t size = STRLEN(dirnames[i]) + pat_len + 7;
char_u *s = xmalloc(size);
@@ -5549,6 +5550,14 @@ static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file,
globpath(p_pp, s, &ga, 0);
xfree(s);
}
+
+ for (int i = 0; dirnames[i] != NULL; i++) {
+ size_t size = STRLEN(dirnames[i]) + pat_len + 22;
+ char_u *s = xmalloc(size);
+ snprintf((char *)s, size, "start/*/%s/%s*.vim", dirnames[i], pat); // NOLINT
+ globpath(p_pp, s, &ga, 0);
+ xfree(s);
+ }
}
if (flags & DIP_OPT) {
@@ -5559,6 +5568,14 @@ static int ExpandRTDir(char_u *pat, int flags, int *num_file, char_u ***file,
globpath(p_pp, s, &ga, 0);
xfree(s);
}
+
+ for (int i = 0; dirnames[i] != NULL; i++) {
+ size_t size = STRLEN(dirnames[i]) + pat_len + 20;
+ char_u *s = xmalloc(size);
+ snprintf((char *)s, size, "opt/*/%s/%s*.vim", dirnames[i], pat); // NOLINT
+ globpath(p_pp, s, &ga, 0);
+ xfree(s);
+ }
}
for (int i = 0; i < ga.ga_len; i++) {
@@ -5606,6 +5623,8 @@ static int ExpandPackAddDir(char_u *pat, int *num_file, char_u ***file)
char_u *s = xmalloc(buflen);
snprintf((char *)s, buflen, "pack/*/opt/%s*", pat); // NOLINT
globpath(p_pp, s, &ga, 0);
+ snprintf((char *)s, buflen, "opt/%s*", pat); // NOLINT
+ globpath(p_pp, s, &ga, 0);
xfree(s);
for (int i = 0; i < ga.ga_len; i++) {