From 7700ee2722ac89ef44112b235c53d291002bc71b Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Mon, 7 Jun 2021 02:22:40 +0430 Subject: [PATCH] LibLine: Actually remove the two levels of deferred_invoke 4d5cdcc89394259019828f123039104d6f4039e2 partially reverted the changes from d8c5eeceabbeaedc29823f12cc8a9cfac6f84686, but it reverted too much and reintroduced the bug. This commit finally fixes the actual bug. The author hasn't been in his best committing state today. --- Userland/Libraries/LibLine/Editor.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index 1e328f2a41..8364510783 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -588,10 +588,8 @@ void Editor::interrupted() m_is_editing = false; restore(); m_notifier->set_enabled(false); - deferred_invoke([this](auto&) { - m_notifier = nullptr; - Core::EventLoop::current().quit(Retry); - }); + m_notifier = nullptr; + Core::EventLoop::current().quit(Retry); } void Editor::resized() @@ -623,12 +621,9 @@ void Editor::really_quit_event_loop() restore(); m_returned_line = string; - m_notifier->set_enabled(false); - deferred_invoke([this](auto&) { - m_notifier = nullptr; - Core::EventLoop::current().quit(Exit); - }); + m_notifier = nullptr; + Core::EventLoop::current().quit(Exit); } auto Editor::get_line(const String& prompt) -> Result