aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
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++) {