-
- if (pars[pit].isInserted(pos)) {
- pars[pit].setChange(pos, Change(Change::UNCHANGED));
- } else if (pars[pit].isDeleted(pos)) {
- if (pit == pars_size - 1) {
- // we cannot remove a par break at the end of the last
- // paragraph; instead, we mark it unchanged
+ if (pars[pit].isChanged(pos)) {
+ // keep the end-of-par char if it is inserted and accepted
+ // or when it is deleted and rejected.
+ if (pars[pit].isInserted(pos) == (op == Text::ACCEPT)) {