]> git.lyx.org Git - lyx.git/commitdiff
better fix for regression introduced by r37463: crash when dissolving an inset. then...
authorStephan Witt <switt@lyx.org>
Thu, 10 Mar 2011 20:15:34 +0000 (20:15 +0000)
committerStephan Witt <switt@lyx.org>
Thu, 10 Mar 2011 20:15:34 +0000 (20:15 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37899 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp

index 266938a2d9b341fd86f552dab9b43d07a535a118..85b3d9857fca3cd5395e9f0252e255fc7e21403c 100644 (file)
@@ -522,7 +522,7 @@ void Cursor::setCursorToAnchor()
 
 void Cursor::markEditPosition()
 {
-       if (inTexted() && new_word_.empty()) {
+       if (lyxrc.spellcheck_continuously && inTexted() && new_word_.empty()) {
                FontSpan ow = locateWord(WHOLE_WORD);
                if (ow.size() == 1) {
                        LYXERR(Debug::DEBUG, "start new word: "
@@ -547,12 +547,15 @@ void Cursor::clearNewWordPosition()
 
 void Cursor::checkNewWordPosition()
 {
-       if (new_word_.empty())
+       if (!lyxrc.spellcheck_continuously || new_word_.empty())
                return ;
        if (!inTexted())
                clearNewWordPosition();
        else {
-               if (pit() != new_word_.pit())
+               // forget the position of the current started word
+               // 1) the paragraph changes or
+               // 2) the count of nested insets changes
+               if (pit() != new_word_.pit() || depth() != new_word_.depth())
                        clearNewWordPosition();
                else {
                        FontSpan nw = locateWord(WHOLE_WORD);