commit 2daf493cbcb3b72ae93f7286e781508957fd1cc6
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Wed Nov 7 11:53:00 2018 -1000

    Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot
    
    Exchanging cells 0 and 1 requires to implement idxBackWard/Forward.
---
 src/mathed/InsetMathRoot.cpp |   24 ++++++++++++++++++++++++
 src/mathed/InsetMathRoot.h   |    4 ++++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp
index b3723fa..5659511 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 63c35b6..d9e92c0 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;

Reply via email to