1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:18:11 +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

@ -518,7 +518,7 @@ int main(int argc, char** argv)
};
editor.strip_styles();
StringBuilder builder;
builder.append({ editor.buffer().data(), editor.buffer().size() });
builder.append(editor.line());
// FIXME: The lexer returns weird position information without this
builder.append(" ");
String str = builder.build();
@ -659,7 +659,7 @@ int main(int argc, char** argv)
if (token.length() == 0)
return {}; // nyeh
StringView line { editor.buffer().data(), editor.cursor() };
auto line = editor.line();
// we're only going to complete either
// - <N>
// where N is part of the name of a variable