]> git.lyx.org Git - features.git/commitdiff
Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 7 Nov 2018 21:53:00 +0000 (11:53 -1000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
Exchanging cells 0 and 1 requires to implement idxBackWard/Forward.

src/mathed/InsetMathRoot.cpp
src/mathed/InsetMathRoot.h

index b3723faca83f11f808b3cf1860d66be57e0d47db..565951114e06c138e9e1ba2811352af59a30fe6d 100644 (file)
@@ -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) <<"))";
index 63c35b6425bc6ecbca49fc59354bd7707b59116f..d9e92c07beffa39828323b431c3a99f2705fee18 100644 (file)
@@ -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;