diff --git a/src/Text.cpp b/src/Text.cpp index 3ff9b63608..c04aef1fd2 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -829,7 +829,7 @@ bool Text::cursorRightOneWord(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 @@ -870,8 +870,8 @@ bool Text::cursorLeftOneWord(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