aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-02-14 09:09:01 +0800
committerGitHub <noreply@github.com>2025-02-14 09:09:01 +0800
commitf247402010d92aa4dc90cc979e33ea6e47f49ee6 (patch)
treedf6deaa84a284c7c51882e5a5b010496dc18b61c /src
parent478c71f03cfdf0d97f3f17e4264fbcf83f4f16f6 (diff)
downloadrneovim-f247402010d92aa4dc90cc979e33ea6e47f49ee6.tar.gz
rneovim-f247402010d92aa4dc90cc979e33ea6e47f49ee6.tar.bz2
rneovim-f247402010d92aa4dc90cc979e33ea6e47f49ee6.zip
vim-patch:9.1.1107: cannot loop through completion menu with fuzzy (#32438)
Problem: cannot loop through completion menu with fuzzy and nosort in 'completeopt' (Tomasz N) Solution: Reset cur to zero and update compl_shown_match when 'completeopt' contains "nosort" but not "noselect" (glepnir) fixes: vim/vim#16624 closes: vim/vim#16629 https://github.com/vim/vim/commit/c0b7ca406ba18640c56e2746d6f6d03549d53072 Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/insexpand.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c
index 736c7ed582..e88f5dbe70 100644
--- a/src/nvim/insexpand.c
+++ b/src/nvim/insexpand.c
@@ -1295,8 +1295,6 @@ static int ins_compl_build_pum(void)
if (!compl_no_select) {
compl_shown_match = comp;
}
- } else if (!fuzzy_sort && i == 0 && !compl_no_select) {
- compl_shown_match = shown_compl;
}
if (!shown_match_ok && comp == compl_shown_match && !compl_no_select) {
cur = i;
@@ -1327,6 +1325,12 @@ static int ins_compl_build_pum(void)
return -1;
}
+ if (fuzzy_filter && !fuzzy_sort && !compl_no_select && !shown_match_ok) {
+ compl_shown_match = shown_compl;
+ shown_match_ok = true;
+ cur = 0;
+ }
+
assert(compl_match_arraysize >= 0);
compl_match_array = xcalloc((size_t)compl_match_arraysize, sizeof(pumitem_T));