patch 9.1.1670: completion: autocomplete breaks second completion

Problem:  completion: autocomplete breaks second completion
          (gravndal)
Solution: Fix the autocomplete bug (Girish Palya)

fixes: #18044
closes: #18068

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-23 06:36:00 -04:00
committed by Christian Brabandt
parent 454c7ea484
commit b4e0bd93a9
5 changed files with 17 additions and 22 deletions

View File

@ -664,9 +664,6 @@ 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))
@ -688,9 +685,6 @@ 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.
@ -997,7 +991,7 @@ doESCkey:
{
update_screen(UPD_VALID); // Show char deletion immediately
out_flush();
ins_compl_set_autocomplete(TRUE);
ins_compl_enable_autocomplete();
goto docomplete; // Trigger autocompletion
}
}
@ -1424,7 +1418,7 @@ normalchar:
{
update_screen(UPD_VALID); // Show character immediately
out_flush();
ins_compl_set_autocomplete(TRUE);
ins_compl_enable_autocomplete();
goto docomplete;
}