1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:04:58 +00:00

LibLine: Handle unicode correctly

This commit also fixes a problem with us throwing out data that was
inserted while a command was running.
This commit is contained in:
AnotherTest 2020-05-18 13:47:34 +04:30 committed by Andreas Kling
parent a4e0b585fe
commit 3bc3f36cfe
4 changed files with 90 additions and 29 deletions

View file

@ -1389,7 +1389,7 @@ void Shell::highlight(Line::Editor&) const
if (m_should_continue == ExitCodeOrContinuationRequest::SingleQuotedString) {
builder.append('\'');
}
builder.append(StringView { editor.buffer().data(), editor.buffer().size() });
builder.append(editor.line());
auto commands = Parser { builder.string_view() }.parse();
auto first_command { true };
for (auto& command : commands) {