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
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