From 041c88c930d5908ecbf6dd44e31ed197d8c4007e Mon Sep 17 00:00:00 2001 From: potatoalienof13 Date: Wed, 21 Dec 2022 17:46:49 -0500 Subject: [PATCH] This commit attempts to fix a crash with -f. Specifically when kakoune is run as > ./kak -f '2oK.k' /dev/null The crash occurs because when is pressed for the second time, it attempts to use m_completions from the first press of . 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. --- src/insert_completer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 83e51d63..c18b3961 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -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(); }