This commit attempts to fix a crash with -f. Specifically when kakoune

is run as

> ./kak -f '2oK.k<c-n><ret><c-n>' /dev/null

The crash occurs because when <c-n> is pressed for the second time,
it attempts to use m_completions from the first press of <c-n>.
This only happens when kakoune is run with -f, because when this is done
interactively, there is a client, which means that m_completions gets
reset.  This removes the check that causes that difference.

I am not *completely* sure that this is the best way to solve the
problem, since I am not completely sure why that check was put there
in the first place.
This commit is contained in:
potatoalienof13 2022-12-21 17:46:49 -05:00
parent 938be7a7b0
commit 041c88c930

View File

@ -481,7 +481,7 @@ bool InsertCompleter::has_candidate_selected() const
void InsertCompleter::try_accept()
{
if (m_completions.is_valid() and m_context.has_client() and has_candidate_selected())
if (m_completions.is_valid() and has_candidate_selected())
reset();
}