mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibLine: Ignore interrupts unless actively editing
It does not make much sense to receive an interrupt and process it *much later*. Also patches Userland/js to only create exceptions while some code is actually running.
This commit is contained in:
parent
8b195d1211
commit
7ecf29f206
Notes:
sideshowbarker
2024-07-19 07:12:33 +09:00
Author: https://github.com/alimpfard
Commit: 7ecf29f206
Pull-request: https://github.com/SerenityOS/serenity/pull/2009
Issue: https://github.com/SerenityOS/serenity/issues/2008
3 changed files with 14 additions and 2 deletions
|
@ -124,6 +124,8 @@ void Editor::stylize(const Span& span, const Style& style)
|
|||
|
||||
String Editor::get_line(const String& prompt)
|
||||
{
|
||||
m_is_editing = true;
|
||||
|
||||
set_prompt(prompt);
|
||||
reset();
|
||||
set_origin();
|
||||
|
@ -139,6 +141,7 @@ String Editor::get_line(const String& prompt)
|
|||
fflush(stdout);
|
||||
auto string = String::copy(m_buffer);
|
||||
m_buffer.clear();
|
||||
m_is_editing = false;
|
||||
return string;
|
||||
}
|
||||
char keybuf[16];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue