diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-08-30 16:34:01 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2025-03-27 07:26:42 +0800 |
commit | 9757b11aaf58cf49b96daa3abe31af2212badbe1 (patch) | |
tree | 2a9d82ae76b565e239011544db7ffd09226edb2c /src | |
parent | a9aedfbc5880b9ac25f7b0ac1dc49fa318dbe89b (diff) | |
download | rneovim-9757b11aaf58cf49b96daa3abe31af2212badbe1.tar.gz rneovim-9757b11aaf58cf49b96daa3abe31af2212badbe1.tar.bz2 rneovim-9757b11aaf58cf49b96daa3abe31af2212badbe1.zip |
vim-patch:9.1.0631: wrong completion list displayed with non-existing dir + fuzzy completion
Problem: wrong completion list displayed with non-existing dir + fuzzy
completion (kawarimidoll)
Solution: clear list of matches, if leader did not use fuzzy match
(glepnir)
fixes: vim/vim#15357
closes: vim/vim#15365
https://github.com/vim/vim/commit/6b6280c4a270547f84f01c0e0d9be1b7d6bb9e20
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/insexpand.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index a02d7a62d2..4cddebf3f9 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3339,6 +3339,7 @@ static void get_next_filename_completion(void) // Move leader to the file part leader = last_sep + 1; + leader_len -= path_len; } } @@ -3392,13 +3393,18 @@ static void get_next_filename_completion(void) FreeWild(num_matches, matches); matches = sorted_matches; num_matches = fuzzy_indices.ga_len; + } else if (leader_len > 0) { + FreeWild(num_matches, matches); + num_matches = 0; } xfree(compl_fuzzy_scores); ga_clear(&fuzzy_indices); } - ins_compl_add_matches(num_matches, matches, p_fic || p_wic); + if (num_matches > 0) { + ins_compl_add_matches(num_matches, matches, p_fic || p_wic); + } } /// Get the next set of command-line completions matching "compl_pattern". |