From: Enrico Forestieri Date: Sat, 10 Nov 2018 13:55:00 +0000 (+0100) Subject: Restore correct left/right navigation in root inset X-Git-Tag: lyx-2.4.0dev-acb2ca7b~2915 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=77234fecd80cef1dfcf8a14e303e29906b99ae85;p=lyx.git Restore correct left/right navigation in root inset Now all cells are correctly visited in sequence when moving with cursor left/right. --- 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;