// Do we need to set insets' buffer_ members, because we copied
// some stuff? We'll assume we do and reset it otherwise.
- bool setBuffers = true;
+ bool set_buffers = true;
switch (mode) {
case OutlineUp: {
}
}
}
- setBuffers = false;
+ set_buffers = false;
break;
}
case OutlineOut: {
}
}
}
- setBuffers = false;
+ set_buffers = false;
break;
}
}
- if (setBuffers)
+ if (set_buffers)
// FIXME This only really needs doing for the newly introduced
// paragraphs. Something like:
// pit_type const numpars = distance(start, finish);
&& cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_FORWARD);
+
+ // we will probably be moving out the inset, so we should execute
+ // the depm-mechanism, but only when the cursor has a place to
+ // go outside this inset, i.e. in a slice above.
+ if (cur.depth() > 1 && cur.pos() == cur.lastpos()
+ && cur.pit() == cur.lastpit()) {
+ // The cursor hasn't changed yet. To give the
+ // DEPM the possibility of doing something we must
+ // provide it with two different cursors.
+ Cursor dummy = cur;
+ dummy.pos() = dummy.pit() = 0;
+ cur.bv().checkDepm(dummy, cur);
+ }
}
break;
&& cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_BACKWARD);
+
+ // we will probably be moving out the inset, so we should execute
+ // the depm-mechanism, but only when the cursor has a place to
+ // go outside this inset, i.e. in a slice above.
+ if (cur.depth() > 1 && cur.pos() == 0 && cur.pit() == 0) {
+ // The cursor hasn't changed yet. To give the
+ // DEPM the possibility of doing something we must
+ // provide it with two different cursors.
+ Cursor dummy = cur;
+ dummy.pos() = cur.lastpos();
+ dummy.pit() = cur.lastpit();
+ cur.bv().checkDepm(dummy, cur);
+ }
}
break;
}
if (!inset)
break;
+ cur.recordUndo();
insertInset(cur, inset);
cur.posForward();
break;