commit 77234fecd80cef1dfcf8a14e303e29906b99ae85
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sat Nov 10 14:55:00 2018 +0100

    Restore correct left/right navigation in root inset
    
    Now all cells are correctly visited in sequence when moving with
    cursor left/right.
---
 src/mathed/InsetMathRoot.cpp |   18 ++++++++++++++++++
 src/mathed/InsetMathRoot.h   |    4 ++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/src/mathed/InsetMathRoot.cpp b/src/mathed/InsetMathRoot.cpp
index f4c8bf8..e0b7efc 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 d9e92c0..088be24 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;

Reply via email to