&& old.pos() == cur[depth].pos();
// If the chars around the old cursor were spaces, delete some of
- // them , but only if the cursor has really moved.
+ // them, but only if the cursor has really moved.
if (!same_par_pos) {
// find range of spaces around cursors
int from = old.pos();
if (from != to && from > 0 && to < oldpar.size())
++from;
+ if (same_par && cur.pos() > from && cur.pos() < to)
+ ++from;
+
// Remove spaces and adapt cursor.
if (from < to) {
oldpar.eraseChars(from, to, cur.buffer()->params().track_changes);
}
}
- // only do our magic if we changed paragraph
+ // only do our other magic if we changed paragraph
if (same_par)
return false;