mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-11 02:29:21 +00:00
LibLine: Correctly slice completion substrings as unicode strings
Ports a fix from Serenity's LibLine.
cee0d979cc
This commit is contained in:
parent
087fcb84cb
commit
5ac0e81c4a
Notes:
github-actions[bot]
2024-09-20 10:58:01 +00:00
Author: https://github.com/alimpfard
Commit: 5ac0e81c4a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1443
3 changed files with 13 additions and 6 deletions
|
@ -383,7 +383,13 @@ void Editor::insert(ByteString const& string)
|
|||
|
||||
void Editor::insert(StringView string_view)
|
||||
{
|
||||
for (auto ch : Utf8View { string_view })
|
||||
auto view = Utf8View { string_view };
|
||||
insert(view);
|
||||
}
|
||||
|
||||
void Editor::insert(Utf8View& view)
|
||||
{
|
||||
for (auto ch : view)
|
||||
insert(ch);
|
||||
}
|
||||
|
||||
|
@ -1205,7 +1211,7 @@ ErrorOr<void> Editor::handle_read_event()
|
|||
m_chars_touched_in_the_middle++;
|
||||
|
||||
for (auto& view : completion_result.insert)
|
||||
insert(view.as_string());
|
||||
insert(view);
|
||||
|
||||
auto stderr_stream = TRY(Core::File::standard_error());
|
||||
TRY(reposition_cursor(*stderr_stream));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue