diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-16 07:07:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-16 07:07:06 +0800 |
commit | aa319da4024a77b0f7c40e08c6f5d5b512a7f899 (patch) | |
tree | 3c7fb8ed8b9e209b4df5807956a4a5667699eca2 /src | |
parent | 7e65f3757bdbe41bbf022b05b6869ad6e7febe0d (diff) | |
download | rneovim-aa319da4024a77b0f7c40e08c6f5d5b512a7f899.tar.gz rneovim-aa319da4024a77b0f7c40e08c6f5d5b512a7f899.tar.bz2 rneovim-aa319da4024a77b0f7c40e08c6f5d5b512a7f899.zip |
vim-patch:9.1.0489: default completion may break with fuzzy (#29364)
Problem: default completion may break with fuzzy
Solution: check that completion_match_array is not null
(glepnir)
closes: vim/vim#15010
https://github.com/vim/vim/commit/aced8c2f4fd1cf3f8ac7cdb0dd54d19ef4390ef8
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/insexpand.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 1eb6402e6c..0a25b72451 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3698,16 +3698,16 @@ static int find_next_completion_match(bool allow_get_expansion, int todo, bool a while (--todo >= 0) { if (compl_shows_dir_forward() && compl_shown_match->cp_next != NULL) { - compl_shown_match = !compl_fuzzy_match ? compl_shown_match->cp_next - : find_comp_when_fuzzy(); + compl_shown_match = compl_fuzzy_match && compl_match_array != NULL + ? find_comp_when_fuzzy() : compl_shown_match->cp_next; found_end = (compl_first_match != NULL && (is_first_match(compl_shown_match->cp_next) || is_first_match(compl_shown_match))); } else if (compl_shows_dir_backward() && compl_shown_match->cp_prev != NULL) { found_end = is_first_match(compl_shown_match); - compl_shown_match = !compl_fuzzy_match ? compl_shown_match->cp_prev - : find_comp_when_fuzzy(); + compl_shown_match = compl_fuzzy_match && compl_match_array != NULL + ? find_comp_when_fuzzy() : compl_shown_match->cp_prev; found_end |= is_first_match(compl_shown_match); } else { if (!allow_get_expansion) { |