diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-06-15 07:20:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-15 07:20:38 +0800 |
commit | 199d852d9f8584217be38efb56b725aa3db62931 (patch) | |
tree | 3ddb9ecb294899ac5dc6f304f1351cdcabea251e /src | |
parent | 6e28589e00a32045d5a62654151299802e40fdb0 (diff) | |
download | rneovim-199d852d9f8584217be38efb56b725aa3db62931.tar.gz rneovim-199d852d9f8584217be38efb56b725aa3db62931.tar.bz2 rneovim-199d852d9f8584217be38efb56b725aa3db62931.zip |
vim-patch:9.1.0487: completed item not update on fuzzy completion (#29341)
Problem: completed item not update on fuzzy completion
Solution: reset compl_shown_match when at original match position
(glepnir)
closes: vim/vim#14955
https://github.com/vim/vim/commit/f94c9c482a6dd488f0136ac99499eb6e2ab3ccca
Co-authored-by: glepnir <glephunter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/insexpand.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 9b6805404f..04e4a59f54 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -1162,6 +1162,7 @@ static int ins_compl_build_pum(void) // Need to build the popup menu list. compl_match_arraysize = 0; compl_T *comp = compl_first_match; + compl_T *after_first_compl = NULL; // If it's user complete function and refresh_always, // do not use "compl_leader" as prefix filter. @@ -1230,6 +1231,9 @@ static int ins_compl_build_pum(void) } cur = i; } else if (compl_fuzzy_match) { + if (i == 0) { + after_first_compl = comp; + } // Update the maximum fuzzy score and the shown match // if the current item's score is higher if (comp->cp_score > max_fuzzy_score) { @@ -1248,6 +1252,9 @@ static int ins_compl_build_pum(void) || (compl_leader == NULL || lead_len == 0))) { shown_match_ok = true; cur = 0; + if (match_at_original_text(compl_shown_match)) { + compl_shown_match = after_first_compl; + } } } |