From: Jean-Marc Lasgouttes Date: Wed, 7 Nov 2018 21:53:00 +0000 (-1000) Subject: Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=33794de82b5c3d9e7cdd078bcc5bc7494ee842a5;p=features.git Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot Exchanging cells 0 and 1 requires to implement idxBackWard/Forward. --- diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp index b3723faca8..565951114e 100644 --- a/src/mathed/InsetMathRoot.cpp +++ b/src/mathed/InsetMathRoot.cpp @@ -156,6 +156,30 @@ bool InsetMathRoot::idxUpDown(Cursor & cur, bool up) const } +bool InsetMathRoot::idxForward(Cursor & cur) const +{ + // nucleus is 0 and is on the right + if (cur.idx() == 0) + return false; + else + cur.idx() = 0; + + return true; +} + + +bool InsetMathRoot::idxBackward(Cursor & cur) const +{ + // nucleus is 0 and is on the right + if (cur.idx() == 1) + return false; + else + cur.idx() = 1; + + 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 63c35b6425..d9e92c07be 100644 --- a/src/mathed/InsetMathRoot.h +++ b/src/mathed/InsetMathRoot.h @@ -26,6 +26,10 @@ public: InsetMathRoot(Buffer * buf); /// bool idxUpDown(Cursor & cur, bool up) const; + /// + bool idxForward(Cursor & cur) const; + /// + bool idxBackward(Cursor & cur) const; /// void metrics(MetricsInfo & mi, Dimension & dim) const;