mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:58:12 +00:00
LibVT: Make TerminalWidget::selected_text() produce UTF-8 strings :^)
This commit is contained in:
parent
86242f9c18
commit
0d78ee95f9
1 changed files with 8 additions and 1 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <AK/StdLibExtras.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <AK/Utf32View.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <Kernel/KeyCode.h>
|
||||
#include <LibCore/ConfigFile.h>
|
||||
|
@ -739,7 +740,13 @@ String TerminalWidget::selected_text() const
|
|||
builder.append('\n');
|
||||
break;
|
||||
}
|
||||
builder.append(line.codepoint(column));
|
||||
// FIXME: This is a bit hackish.
|
||||
if (line.is_utf32()) {
|
||||
u32 codepoint = line.codepoint(column);
|
||||
builder.append(Utf32View(&codepoint, 1));
|
||||
} else {
|
||||
builder.append(line.codepoint(column));
|
||||
}
|
||||
if (column == line.length() - 1 || (m_rectangle_selection && column == last_column)) {
|
||||
builder.append('\n');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue