diff --git a/poincare/src/empty_layout_node.cpp b/poincare/src/empty_layout_node.cpp index 31f2d997b..6956b87d1 100644 --- a/poincare/src/empty_layout_node.cpp +++ b/poincare/src/empty_layout_node.cpp @@ -73,8 +73,12 @@ void EmptyLayoutNode::moveCursorVertically(VerticalDirection direction, LayoutCu bool EmptyLayoutNode::willAddSibling(LayoutCursor * cursor, LayoutNode * sibling, bool moveCursor) { if (sibling->mustHaveLeftSibling()) { m_color = Color::Yellow; + return true; + } else { + LayoutRef(this).replaceWith(LayoutRef(sibling), cursor); + // WARNING: do not call "this" afterwards + return false; } - return true; /* Color currentColor = m_color; int currentIndexInParent = indexInParent(); if (currentColor == Color::Grey) {