mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
LibLine: Capture the current origin immediately after ^C
Otherwise a subsequent event (^C or resize) will make LibLine use the previous origin instead of the real current one.
This commit is contained in:
parent
f87d93b4ee
commit
869c7c9bab
1 changed files with 2 additions and 2 deletions
|
@ -622,7 +622,6 @@ ErrorOr<void> Editor::interrupted()
|
|||
TRY(reposition_cursor(*stderr_stream, true));
|
||||
if (TRY(m_suggestion_display->cleanup()))
|
||||
TRY(reposition_cursor(*stderr_stream, true));
|
||||
TRY(stderr_stream->write_until_depleted("\n"sv.bytes()));
|
||||
}
|
||||
m_buffer.clear();
|
||||
m_chars_touched_in_the_middle = buffer().size();
|
||||
|
@ -817,7 +816,7 @@ void Editor::handle_interrupt_event()
|
|||
|
||||
m_previous_interrupt_was_handled_as_interrupt = true;
|
||||
|
||||
fprintf(stderr, "^C");
|
||||
fprintf(stderr, "^C\r\n");
|
||||
fflush(stderr);
|
||||
|
||||
if (on_interrupt_handled)
|
||||
|
@ -826,6 +825,7 @@ void Editor::handle_interrupt_event()
|
|||
m_buffer.clear();
|
||||
m_chars_touched_in_the_middle = buffer().size();
|
||||
m_cursor = 0;
|
||||
set_origin(false);
|
||||
|
||||
finish();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue