diff --git a/escher/include/escher/expression_field.h b/escher/include/escher/expression_field.h index e89c1dc98..f0931d5db 100644 --- a/escher/include/escher/expression_field.h +++ b/escher/include/escher/expression_field.h @@ -26,7 +26,7 @@ public: bool inputViewHeightDidChange(); bool handleEventWithText(const char * text, bool indentation = false, bool forceCursorRightOfText = false); void setLayoutInsertionCursorEvent(Ion::Events::Event event) { m_layoutField.setInsertionCursorEvent(event); } - size_t dumpLayout(char * buffer, size_t bufferSize) const; + size_t dumpLayout(char * buffer, size_t bufferSize); void restoreLayout(const char * buffer, size_t size); /* View */ diff --git a/escher/src/expression_field.cpp b/escher/src/expression_field.cpp index 46d09b611..723d89543 100644 --- a/escher/src/expression_field.cpp +++ b/escher/src/expression_field.cpp @@ -122,7 +122,7 @@ KDCoordinate ExpressionField::inputViewHeight() const { std::max(k_minimalHeight, m_layoutField.minimalSizeForOptimalDisplay().height()))); } -size_t ExpressionField::dumpLayout(char * buffer, size_t bufferSize) const { +size_t ExpressionField::dumpLayout(char * buffer, size_t bufferSize) { size_t size; size_t returnValue; char * currentLayout; @@ -146,6 +146,7 @@ size_t ExpressionField::dumpLayout(char * buffer, size_t bufferSize) const { buffer[0] = 0; return 0; } + m_layoutField.putCursorRightOfLayout(); size = m_layoutField.layout().size(); currentLayout = reinterpret_cast(m_layoutField.layout().node()); returnValue = size; diff --git a/escher/src/layout_field.cpp b/escher/src/layout_field.cpp index ff6b493dd..4ee8e166f 100644 --- a/escher/src/layout_field.cpp +++ b/escher/src/layout_field.cpp @@ -336,6 +336,7 @@ CodePoint LayoutField::XNTCodePoint(CodePoint defaultXNTCodePoint) { void LayoutField::putCursorRightOfLayout() { m_contentView.cursor()->layout().removeGreySquaresFromAllMatrixAncestors(); + m_contentView.cursor()->showEmptyLayoutIfNeeded(); m_contentView.setCursor(LayoutCursor(m_contentView.expressionView()->layout(), LayoutCursor::Position::Right)); }