bool const cur_moved = cursorForward(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && 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;
- if (cur.bv().checkDepm(dummy, cur))
- cur.forceBufferUpdate();
- }
+ // we will be moving out the inset, so we should execute
+ // the depm-mechanism.
+ // 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;
+ if (cur.bv().checkDepm(dummy, cur))
+ cur.forceBufferUpdate();
}
break;
}
bool const cur_moved = cursorBackward(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && 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();
- if (cur.bv().checkDepm(dummy, cur))
- cur.forceBufferUpdate();
- }
+ // we will be moving out the inset, so we should execute
+ // the depm-mechanism.
+ // 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();
+ if (cur.bv().checkDepm(dummy, cur))
+ cur.forceBufferUpdate();
}
break;
}
needsUpdate |= cur.selHandle(act == LFUN_CHAR_LEFT_SELECT);
bool const cur_moved = cursorVisLeft(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_LEFT);
}
needsUpdate |= cur.selHandle(cmd.action() == LFUN_CHAR_RIGHT_SELECT);
bool const cur_moved = cursorVisRight(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
}
needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_RIGHT_SELECT);
bool const cur_moved = cursorVisRightOneWord(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
}
bool const cur_moved = cursorForwardOneWord(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && 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;
- if (cur.bv().checkDepm(dummy, cur))
- cur.forceBufferUpdate();
- }
+ // we will be moving out the inset, so we should execute
+ // the depm-mechanism.
+ // 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;
+ if (cur.bv().checkDepm(dummy, cur))
+ cur.forceBufferUpdate();
}
break;
}
needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_LEFT_SELECT);
bool const cur_moved = cursorVisLeftOneWord(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_LEFT);
}
bool const cur_moved = cursorBackwardOneWord(cur);
needsUpdate |= cur_moved;
- if (!cur_moved && oldTopSlice == cur.top()
- && cur.boundary() == oldBoundary) {
+ if (!cur_moved && cur.depth() > 1
+ && oldTopSlice == cur.top() && 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();
- if (cur.bv().checkDepm(dummy, cur))
- cur.forceBufferUpdate();
- }
+ // we will be moving out the inset, so we should execute
+ // the depm-mechanism.
+ // 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();
+ if (cur.bv().checkDepm(dummy, cur))
+ cur.forceBufferUpdate();
}
break;
}