1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:17:44 +00:00

LibLine: Use Core::EventLoop for outer read loop

This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
This commit is contained in:
AnotherTest 2020-05-26 15:04:39 +04:30 committed by Andreas Kling
parent 8e6df3949d
commit 70a213a6ec
7 changed files with 583 additions and 517 deletions

View file

@ -110,10 +110,9 @@ Core::EventLoop loop;
int run(Function<void(const char*, size_t)> fn)
{
if (interactive) {
Line::Editor editor;
editor.initialize();
auto editor = Line::Editor::construct();
for (;;) {
auto line_result = editor.get_line("> ");
auto line_result = editor->get_line("> ");
if (line_result.is_error())
break;