mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibLine: Add a hook to run when an interrupt is handled
We do not want to clog up signal handlers by putting possibly complex logic inside them, so allow the editor to handle that.
This commit is contained in:
parent
2c45076e68
commit
98d25324fd
Notes:
sideshowbarker
2024-07-19 06:40:35 +09:00
Author: https://github.com/alimpfard
Commit: 98d25324fd
Pull-request: https://github.com/SerenityOS/serenity/pull/2212
Reviewed-by: https://github.com/Dexesttp
2 changed files with 5 additions and 0 deletions
|
@ -171,6 +171,10 @@ String Editor::get_line(const String& prompt)
|
|||
|
||||
m_buffer.clear();
|
||||
m_cursor = 0;
|
||||
|
||||
if (on_interrupt_handled)
|
||||
on_interrupt_handled();
|
||||
|
||||
m_refresh_needed = true;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue