patch 9.1.1657: Autocompletion adds delay

Problem:  Autocompletion adds delay
          (gcanat, char101, after v9.1.1638)
Solution: Temporarily disable autocomplation (Girish Palya).

related: #17960
fixes: #18022
closes: #18048

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Girish Palya
2025-08-20 21:15:06 +02:00
committed by Christian Brabandt
parent 84a343a6ed
commit 196c376682
8 changed files with 66 additions and 14 deletions

View File

@ -664,6 +664,9 @@ edit(
continue;
}
if (p_ac)
ins_compl_set_autocomplete(TRUE);
// A non-white character that fits in with the current
// completion: Add to "compl_leader".
if (ins_compl_accept_char(c))
@ -685,6 +688,9 @@ edit(
continue;
}
if (p_ac)
ins_compl_set_autocomplete(FALSE);
// Pressing CTRL-Y selects the current match. When
// ins_compl_enter_selects() is set the Enter key does the
// same.
@ -987,10 +993,11 @@ doESCkey:
&& curwin->w_cursor.col > 0)
{
c = char_before_cursor();
if (ins_compl_setup_autocompl(c))
if (vim_isprintc(c))
{
update_screen(UPD_VALID); // Show char deletion immediately
out_flush();
ins_compl_set_autocomplete(TRUE);
goto docomplete; // Trigger autocompletion
}
}
@ -1413,10 +1420,11 @@ normalchar:
foldOpenCursor();
#endif
// Trigger autocompletion
if (p_ac && !char_avail() && ins_compl_setup_autocompl(c))
if (p_ac && !char_avail() && vim_isprintc(c))
{
update_screen(UPD_VALID); // Show character immediately
out_flush();
ins_compl_set_autocomplete(TRUE);
goto docomplete;
}