]> git.lyx.org Git - lyx.git/commitdiff
Fix entering inset in visual cursor mode
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jan 2016 09:10:26 +0000 (10:10 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 5 Jan 2016 14:03:30 +0000 (15:03 +0100)
Improve the test whether cursor has moved in Cursor::posVisLeft. The code for posVisRight had already been fixed for #5764 at 0730c923, but this replaces both tests by the proper == operator.

Fixes bug #9913.

src/Cursor.cpp

index 09407a38533661c38a22e9077157bd9a82cfb32b..c1eb32f684b34876766c5016ee10752821c0b910 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()