}
par.insertChar(cur.pos(), c, cur.current_font, cur.buffer().params().trackChanges);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
// cur.updateFlags(Update::Force);
setCursor(cur.top(), cur.pit(), cur.pos() + 1);
cursorForwardOneWord(cur);
cur.setSelection();
cutSelection(cur, true, false);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
}
}
cursorBackwardOneWord(cur);
cur.setSelection();
cutSelection(cur, true, false);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
}
}
CursorSlice from;
CursorSlice to;
+ bool gotsel = false;
if (cur.selection()) {
from = cur.selBegin();
to = cur.selEnd();
+ gotsel = true;
} else {
from = cur.top();
getWord(from, to, PARTIAL_WORD);
}
// the selection may have changed due to logically-only deleted chars
- setCursor(cur, begPit, begPos);
- cur.resetAnchor();
- setCursor(cur, endPit, right);
- cur.setSelection();
+ if (gotsel) {
+ setCursor(cur, begPit, begPos);
+ cur.resetAnchor();
+ setCursor(cur, endPit, right);
+ cur.setSelection();
+ } else
+ setCursor(cur, endPit, right);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
}
// the character has been logically deleted only => skip it
cur.top().forwardPos();
}
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
needsUpdate = true;
} else {
if (cur.pit() == cur.lastpit())
// Make sure the cursor is correct. Is this really needed?
// No, not really... at least not here!
cur.text()->setCursor(cur.top(), cur.pit(), cur.pos());
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
}
return needsUpdate;
setCursorIntern(cur, cur.pit(), cur.pos() - 1,
false, cur.boundary());
cur.paragraph().eraseChar(cur.pos(), cur.buffer().params().trackChanges);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
}
if (cur.pos() == cur.lastpos())
par.insertChar(pos1, char2, font2, trackChanges);
par.insertChar(pos2, char1, font1, trackChanges);
- checkBufferStructure(cur.buffer(), cur);
+ cur.checkBufferStructure();
// After the transposition, move cursor to after the transposition.
setCursor(cur, cur.pit(), pos2);