]> git.lyx.org Git - features.git/commitdiff
improve left/right navigation in root inset
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 9 Nov 2018 05:22:04 +0000 (21:22 -0800)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:51 +0000 (14:39 +0200)
Now the cursor is correctly set when changing cell with xursor left/right.

src/mathed/InsetMathRoot.cpp

index 565951114e06c138e9e1ba2811352af59a30fe6d..f4c8bf82ad7d151f8ed0791ff5305645387c468b 100644 (file)
@@ -161,9 +161,9 @@ bool InsetMathRoot::idxForward(Cursor & cur) const
        // nucleus is 0 and is on the right
        if (cur.idx() == 0)
                return false;
-       else
-               cur.idx() = 0;
 
+       cur.idx() = 0;
+       cur.pos() = 0;
        return true;
 }
 
@@ -173,9 +173,9 @@ bool InsetMathRoot::idxBackward(Cursor & cur) const
        // nucleus is 0 and is on the right
        if (cur.idx() == 1)
                return false;
-       else
-               cur.idx() = 1;
 
+       cur.idx() = 1;
+       cur.pos() = cur.lastpos();
        return true;
 }