Hi,
the following (committed) patch fixes a deterministic crash with
inset-dissolve if you press erase at the end of the inset.
ATTENTION:
I fixed the bug by aligning erase() and backspace(). However, there are
still some differences between them that look suspicious. Could some
core developer please have a look at both functions? I am rather
clueless but it should be simple for someone who understands the
cursor/needsupdate mechanism.
Michael
Index: text.C
===================================================================
--- text.C (Revision 16049)
+++ text.C (Arbeitskopie)
@@ -1668,7 +1668,10 @@
if (par.isDeleted(cur.pos()))
cur.forwardPosNoDescend();
needsUpdate = true;
- } else if (cur.pit() != cur.lastpit()) {
+ } else {
+ if (cur.pit() == cur.lastpit())
+ return dissolveInset(cur);
+
if (!par.isMergedOnEndOfParDeletion(cur.buffer().params().trackChanges)) {
par.setChange(cur.pos(), Change(Change::DELETED));
cur.forwardPos();
@@ -1677,8 +1680,6 @@
setCursorIntern(cur, cur.pit() + 1, 0);
needsUpdate = backspacePos0(cur);
}
- } else {
- needsUpdate = dissolveInset(cur);
}
// FIXME: Inserting characters has nothing to do with setting a cursor.