]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
Always place the cursor before a separator inset when moving up or down.
[lyx.git] / src / Cursor.cpp
index 09407a38533661c38a22e9077157bd9a82cfb32b..bc1219733f99a71d851d34ef5c6736336ca749f0 100644 (file)
@@ -744,10 +744,7 @@ bool Cursor::posVisRight(bool skip_inset)
 
        }
 
-       bool moved = (new_cur.pos() != pos()
-                                 || new_cur.pit() != pit()
-                                 || new_cur.boundary() != boundary()
-                                 || &new_cur.inset() != &inset());
+       bool const moved = new_cur != *this || new_cur.boundary() != boundary();
 
        if (moved) {
                LYXERR(Debug::RTL, "moving to: " << new_cur.pos()
@@ -843,9 +840,7 @@ bool Cursor::posVisLeft(bool skip_inset)
 
        }
 
-       bool moved = (new_cur.pos() != pos()
-                                 || new_cur.pit() != pit()
-                                 || new_cur.boundary() != boundary());
+       bool const moved = new_cur != *this || new_cur.boundary() != boundary();
 
        if (moved) {
                LYXERR(Debug::RTL, "moving to: " << new_cur.pos()
@@ -1952,6 +1947,8 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
                        // Make sure that cur gets back whatever happened to dummy (Lgb)
                        operator=(dummy);
                }
+               if (pos() && paragraph().isEnvSeparator(pos() - 1))
+                       posBackward();
        } else {
                // if there is a selection, we stay out of any inset,
                // and just jump to the right position: