1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-07 20:27:36 +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:
AnotherTest 2020-04-29 00:31:22 +04:30 committed by Andreas Kling
parent 8b195d1211
commit 7ecf29f206
3 changed files with 14 additions and 2 deletions

View file

@ -107,7 +107,11 @@ public:
// FIXME: we will have to kindly ask our instantiators to set our signal handlers
// since we can not do this cleanly ourselves (signal() limitation: cannot give member functions)
void interrupted() { m_was_interrupted = true; }
void interrupted()
{
if (m_is_editing)
m_was_interrupted = true;
}
void resized() { m_was_resized = true; }
size_t cursor() const { return m_cursor; }
@ -148,6 +152,8 @@ public:
m_finish = true;
}
bool is_editing() const { return m_is_editing; }
private:
void vt_save_cursor();
void vt_restore_cursor();
@ -291,6 +297,8 @@ private:
bool m_initialized { false };
bool m_refresh_needed { false };
bool m_is_editing { false };
};
}