]> git.lyx.org Git - lyx.git/commitdiff
Restore correct left/right navigation in root inset
authorEnrico Forestieri <forenr@lyx.org>
Sat, 10 Nov 2018 13:55:00 +0000 (14:55 +0100)
committerEnrico Forestieri <forenr@lyx.org>
Sat, 10 Nov 2018 13:55:00 +0000 (14:55 +0100)
Now all cells are correctly visited in sequence when moving with
cursor left/right.

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

index f4c8bf82ad7d151f8ed0791ff5305645387c468b..e0b7efc90b222df3f32d8145162ab200dcbdc6e0 100644 (file)
@@ -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) <<"))";
index d9e92c07beffa39828323b431c3a99f2705fee18..088be24c050be975dff041a3946d36fc3c124733 100644 (file)
@@ -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;