vim-patch:9.1.1790: completion: Enter does not insert match with "noinsert" (#35917)

Problem:  completion: Enter does not insert match with "noinsert".
          (Sergey Vlasov)
Solution: Check for compl_shown_match instead of compl_selected_item
          (zeertzjq).

fixes: vim/vim#18386
related: vim/vim#1653
closes: vim/vim#18395

ef818ae444
This commit is contained in:
zeertzjq
2025-09-26 07:37:02 +08:00
committed by GitHub
parent 0646d0ea28
commit d9fa495608
2 changed files with 54 additions and 6 deletions

View File

@@ -5451,7 +5451,7 @@ static int ins_compl_next(bool allow_get_expansion, int count, bool insert_match
// Enter will select a match when the match wasn't inserted and the popup
// menu is visible.
if (compl_no_insert && !started && compl_selected_item != -1) {
if (compl_no_insert && !started && !match_at_original_text(compl_shown_match)) {
compl_enter_selects = true;
} else {
compl_enter_selects = !insert_match && compl_match_array != NULL;