Skip to content

Commit

Permalink
fix(completion): stop completion when completion is exhausted
Browse files Browse the repository at this point in the history
Problem: Currently, completion is not stopped when completion is exhausted (no matching completion items), which also means `CompleteDone` is not called either. Furthermore, `CompleteDone` is called when pressing a special character (Backspace, Space, Esc) instead.

Solution: Correctly stop completion and trigger `CompleteDone` when completion is exhausted.
  • Loading branch information
famiu committed Apr 28, 2024
1 parent 6106365 commit 957c8ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/nvim/insexpand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,10 @@ void ins_compl_show_pum(void)
}

if (compl_match_array == NULL) {
if (compl_started && has_event(EVENT_COMPLETECHANGED)) {
// Stop completion when completion is exhausted
if (ctrl_x_mode_not_default()) {
ins_compl_prep(' ');
} else if (compl_started && has_event(EVENT_COMPLETECHANGED)) {
trigger_complete_changed_event(cur);
}
return;
Expand Down

0 comments on commit 957c8ec

Please sign in to comment.