diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-07-08 23:29:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 23:29:24 +0800 |
commit | fbeef0d4ef1aadc4e50b9f33946cf4dca8ca6b62 (patch) | |
tree | b23befeae7113e5a559227454a5155e579bd5f69 /src/nvim/runtime.c | |
parent | b9a0e762f1d79d17631b7d17cf25b6e25006d8c2 (diff) | |
download | rneovim-fbeef0d4ef1aadc4e50b9f33946cf4dca8ca6b62.tar.gz rneovim-fbeef0d4ef1aadc4e50b9f33946cf4dca8ca6b62.tar.bz2 rneovim-fbeef0d4ef1aadc4e50b9f33946cf4dca8ca6b62.zip |
fix(completion): don't add backslashes to runtime pattern (#24296)
Problem: Bashslashes added as regexp in runtime completion may be
treated as path separator with some 'isfname' value.
Solution: Make curly braces work for runtime completion and use it.
Diffstat (limited to 'src/nvim/runtime.c')
-rw-r--r-- | src/nvim/runtime.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/runtime.c b/src/nvim/runtime.c index 0503c08af9..679f4c2662 100644 --- a/src/nvim/runtime.c +++ b/src/nvim/runtime.c @@ -338,7 +338,7 @@ int do_in_path(char *path, char *name, int flags, DoInRuntimepathCB callback, vo } int ew_flags = ((flags & DIP_DIR) ? EW_DIR : EW_FILE) - | (flags & DIP_DIRFILE) ? (EW_DIR|EW_FILE) : 0; + | ((flags & DIP_DIRFILE) ? (EW_DIR|EW_FILE) : 0); // Expand wildcards, invoke the callback for each match. if (gen_expand_wildcards(1, &buf, &num_files, &files, ew_flags) == OK) { @@ -1222,9 +1222,9 @@ static void ExpandRTDir_int(char *pat, size_t pat_len, int flags, bool keep_ext, bool expand_dirs = false; if (*dirnames[i] == NUL) { // empty dir used for :runtime - snprintf(tail, tail_buflen, "%s*.\\(vim\\|lua\\)", pat); + snprintf(tail, tail_buflen, "%s*.{vim,lua}", pat); } else { - snprintf(tail, tail_buflen, "%s/%s*.\\(vim\\|lua\\)", dirnames[i], pat); + snprintf(tail, tail_buflen, "%s/%s*.{vim,lua}", dirnames[i], pat); } expand: |