]> git.lyx.org Git - lyx.git/blobdiff - src/Text.cpp
Thanks, Abdel.
[lyx.git] / src / Text.cpp
index 44de33c46a7e2f714dd1a6efbeb3daa6c603f24a..09c6f49ab1b2f828021d7415c51e17c4fc551cec 100644 (file)
@@ -590,15 +590,16 @@ bool Text::cursorForwardOneWord(Cursor & cur)
        Paragraph const & par = cur.paragraph();
 
        // Paragraph boundary is a word boundary
-       if (pos == lastpos)
+       if (pos == lastpos) {
                if (pit != cur.lastpit())
                        return setCursor(cur, pit + 1, 0);
                else
                        return false;
+       }
 
        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
@@ -639,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