]> git.lyx.org Git - lyx.git/blobdiff - src/Cursor.cpp
* sk.po
[lyx.git] / src / Cursor.cpp
index 59d2dd78c9db2d44fca1820d30ea7b6ff20646f4..266938a2d9b341fd86f552dab9b43d07a535a118 100644 (file)
@@ -402,7 +402,7 @@ void Cursor::dispatch(FuncRequest const & cmd0)
                bool badcursor = notifyCursorLeavesOrEnters(old, *this);
                if (badcursor) {
                        fixIfBroken();
-                       bv().fixInlineCompletionPos();
+                       bv().resetInlineCompletionPos();
                }
                old.endUndoGroup();
        }
@@ -552,17 +552,21 @@ void Cursor::checkNewWordPosition()
        if (!inTexted())
                clearNewWordPosition();
        else {
-               if (paragraph().id() != new_word_.paragraph().id())
+               if (pit() != new_word_.pit())
                        clearNewWordPosition();
                else {
-                       FontSpan ow = new_word_.locateWord(WHOLE_WORD);
                        FontSpan nw = locateWord(WHOLE_WORD);
-                       if (nw.intersect(ow).empty())
+                       if (nw.size()) {
+                               FontSpan ow = new_word_.locateWord(WHOLE_WORD);
+                               if (nw.intersect(ow).empty())
+                                       clearNewWordPosition();
+                               else
+                                       LYXERR(Debug::DEBUG, "new word: "
+                                                  << " par: " << pit()
+                                                  << " pos: " << nw.first << ".." << nw.last);
+                       } else {
                                clearNewWordPosition();
-                       else
-                               LYXERR(Debug::DEBUG, "new word: "
-                                       << " par: " << pit()
-                                       << " pos: " << nw.first << ".." << nw.last);
+                       }
                }
        }
 }