]> git.lyx.org Git - lyx.git/commitdiff
* Text.cpp (cursorForwardOneWord, cursorBackwardOneWord): fix
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 8 Jul 2008 09:19:41 +0000 (09:19 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 8 Jul 2008 09:19:41 +0000 (09:19 +0000)
moving in mac-like mode (a space is not a char)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25504 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text.cpp

index 1bde616c3183a1d2bacaec2a2fb8c7541e3acc5b..db5ce872adebb8e5a3ebc121e21ca6045f110026 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
@@ -641,7 +641,7 @@ bool Text::cursorBackwardOneWord(Cursor & cur)
 
        if (lyxrc.mac_like_word_movement) {
                // Skip through puctuation and spaces.
-               while (pos != 0 && par.isChar(pos - 1))
+               while (pos != 0 && (par.isChar(pos - 1) || par.isSpace(pos - 1)))
                        --pos;
 
                // Skip over either a non-char inset or a full word