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

LibLine: Expose actual_rendered_string_length & accept newlines in prompt

This commit is contained in:
AnotherTest 2020-05-10 11:30:38 +04:30 committed by Andreas Kling
parent 1d0d0e9d00
commit ccdef5a675
2 changed files with 6 additions and 2 deletions

View file

@ -1031,6 +1031,11 @@ size_t Editor::actual_rendered_string_length(const StringView& string) const
state = Escape;
continue;
}
if (c == '\r' || c == '\n') {
// reset length to 0, since we either overwrite, or are on a newline
length = 0;
continue;
}
// FIXME: This will not support anything sophisticated
++length;
break;