[escher/layout_field] Allow copy-paste of ^2

This commit is contained in:
Léa Saviot
2020-01-10 11:10:16 +01:00
parent 8f86769cd1
commit 408a33f8a6

View File

@@ -168,6 +168,14 @@ void LayoutField::ContentView::copySelection() {
if (m_selectionStart == m_selectionEnd) {
m_selectionStart.serializeParsedExpression(buffer, bufferSize);
if (buffer[0] == 0) {
int offset = 0;
if (m_selectionStart.type() == LayoutNode::Type::VerticalOffsetLayout) {
assert(bufferSize > 1);
buffer[offset++] = UCodePointEmpty;
}
m_selectionStart.serializeForParsing(buffer + offset, bufferSize - offset);
}
} else {
Layout selectionParent = m_selectionStart.parent();
assert(!selectionParent.isUninitialized());