From 77234fecd80cef1dfcf8a14e303e29906b99ae85 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sat, 10 Nov 2018 14:55:00 +0100 Subject: [PATCH] Restore correct left/right navigation in root inset Now all cells are correctly visited in sequence when moving with cursor left/right. --- src/mathed/InsetMathRoot.cpp | 18 ++++++++++++++++++ src/mathed/InsetMathRoot.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index f4c8bf82ad..e0b7efc90b 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -180,6 +180,24 @@ bool InsetMathRoot::idxBackward(Cursor & cur) const } +bool InsetMathRoot::idxFirst(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 1; + cur.pos() = 0; + return true; +} + + +bool InsetMathRoot::idxLast(Cursor & cur) const +{ + LASSERT(&cur.inset() == this, return false); + cur.idx() = 0; + cur.pos() = cur.lastpos(); + return true; +} + + void InsetMathRoot::maple(MapleStream & os) const { os << '(' << cell(0) << ")^(1/(" << cell(1) <<"))"; diff --git a/src/mathed/InsetMathRoot.h b/src/mathed/InsetMathRoot.h index d9e92c07be..088be24c05 100644 --- a/src/mathed/InsetMathRoot.h +++ b/src/mathed/InsetMathRoot.h @@ -30,6 +30,10 @@ public: bool idxForward(Cursor & cur) const; /// bool idxBackward(Cursor & cur) const; + /// + bool idxFirst(Cursor &) const; + /// + bool idxLast(Cursor &) const; /// void metrics(MetricsInfo & mi, Dimension & dim) const; -- 2.39.5