- // the counters may have changed
- updateCounters(cur.buffer());
- setCursor(cur, cur.pit(), cur.pos(), false);
+ // the counters may have changed
+ ParIterator par_it(cur);
+ updateLabels(cur.buffer(), par_it);
+
+ setCursor(cur, cur.pit(), cur.pos(), false);
+ }
+ return needsUpdate;
+}
+
+
+bool LyXText::backspace(LCursor & cur)
+{
+ BOOST_ASSERT(this == cur.text());
+ bool needsUpdate = false;
+ if (cur.pos() == 0) {
+ // The cursor is at the beginning of a paragraph, so
+ // the the backspace will collapse two paragraphs into
+ // one.
+
+ if (cur.pit() != 0 && cur.buffer().params().tracking_changes) {
+ // Previous paragraph, mark "carriage return" as
+ // deleted:
+ Paragraph & par = pars_[cur.pit() - 1];
+ // Take care of a just inserted para break:
+ if (par.lookupChange(par.size()) != Change::INSERTED) {
+ par.setChange(par.size(), Change::DELETED);
+ setCursorIntern(cur, cur.pit() - 1, par.size());
+ return true;
+ }