]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Fix the rest of bug 5010.
[lyx.git] / src / Text.cpp
index 1bde616c3183a1d2bacaec2a2fb8c7541e3acc5b..09c6f49ab1b2f828021d7415c51e17c4fc551cec 100644 (file)
@@ -599,7 +599,7 @@ bool Text::cursorForwardOneWord(Cursor & cur)
 
        if (lyxrc.mac_like_word_movement) {
                // Skip through trailing punctuation and spaces.
-               while (pos != lastpos && par.isChar(pos))
+               while (pos != lastpos && (par.isChar(pos) || par.isSpace(pos)))
                         ++pos;
 
                // Skip over either a non-char inset or a full word
@@ -640,8 +640,8 @@ bool Text::cursorBackwardOneWord(Cursor & cur)
                return setCursor(cur, pit - 1, getPar(pit - 1).size());
 
        if (lyxrc.mac_like_word_movement) {
-               // Skip through puctuation and spaces.
-               while (pos != 0 && par.isChar(pos - 1))
+               // Skip through punctuation and spaces.
+               while (pos != 0 && (par.isChar(pos - 1) || par.isSpace(pos - 1)))
                        --pos;
 
                // Skip over either a non-char inset or a full word