1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:47:44 +00:00

LibLine: Close the search editor when it's interrupted

Fixes #5233.
This commit is contained in:
AnotherTest 2021-02-07 03:12:17 +03:30 committed by Andreas Kling
parent 5204c9062c
commit 3a231c00aa
3 changed files with 13 additions and 1 deletions

View file

@ -539,7 +539,7 @@ void Editor::interrupted()
m_was_interrupted = true;
handle_interrupt_event();
if (!m_finish)
if (!m_finish || !m_previous_interrupt_was_handled_as_interrupt)
return;
m_finish = false;
@ -681,11 +681,14 @@ void Editor::try_update_once()
void Editor::handle_interrupt_event()
{
m_was_interrupted = false;
m_previous_interrupt_was_handled_as_interrupt = false;
m_callback_machine.interrupted(*this);
if (!m_callback_machine.should_process_last_pressed_key())
return;
m_previous_interrupt_was_handled_as_interrupt = true;
fprintf(stderr, "^C");
fflush(stderr);