diff --git a/src/Text3.cpp b/src/Text3.cpp index f6f449af34..b5860cdd8e 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -766,6 +766,25 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_WORD_FORWARD_SELECT: needsUpdate |= cur.selHandle(cmd.action == LFUN_WORD_FORWARD_SELECT); needsUpdate |= cursorForwardOneWord(cur); + + if (!needsUpdate && 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; + cur.bv().checkDepm(dummy, cur); + } + } break; case LFUN_WORD_LEFT: @@ -795,6 +814,26 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_WORD_BACKWARD_SELECT: needsUpdate |= cur.selHandle(cmd.action == LFUN_WORD_BACKWARD_SELECT); needsUpdate |= cursorBackwardOneWord(cur); + + if (!needsUpdate && 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(); + cur.bv().checkDepm(dummy, cur); + } + } break; case LFUN_WORD_SELECT: { diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index e55044ec89..104d9b4350 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3416,7 +3416,15 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) case LFUN_CHAR_RIGHT_SELECT: case LFUN_CHAR_RIGHT: case LFUN_CHAR_LEFT_SELECT: - case LFUN_CHAR_LEFT: { + case LFUN_CHAR_LEFT: + case LFUN_WORD_FORWARD: + case LFUN_WORD_FORWARD_SELECT: + case LFUN_WORD_BACKWARD: + case LFUN_WORD_BACKWARD_SELECT: + case LFUN_WORD_RIGHT: + case LFUN_WORD_RIGHT_SELECT: + case LFUN_WORD_LEFT: + case LFUN_WORD_LEFT_SELECT: { // determine whether we move to next or previous cell, where to enter // the new cell from, and which command to "finish" (i.e., exit the // inset) with: @@ -3425,21 +3433,27 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) FuncCode finish_lfun; if (cmd.action == LFUN_CHAR_FORWARD - || cmd.action == LFUN_CHAR_FORWARD_SELECT) { + || cmd.action == LFUN_CHAR_FORWARD_SELECT + || cmd.action == LFUN_WORD_FORWARD + || cmd.action == LFUN_WORD_FORWARD_SELECT) { next_cell = true; finish_lfun = LFUN_FINISHED_FORWARD; } else if (cmd.action == LFUN_CHAR_BACKWARD - || cmd.action == LFUN_CHAR_BACKWARD_SELECT) { + || cmd.action == LFUN_CHAR_BACKWARD_SELECT + || cmd.action == LFUN_WORD_BACKWARD + || cmd.action == LFUN_WORD_BACKWARD_SELECT) { next_cell = false; finish_lfun = LFUN_FINISHED_BACKWARD; } // LEFT or RIGHT commands --- the interpretation will depend on the // table's direction. else { - bool right = (cmd.action == LFUN_CHAR_RIGHT - || cmd.action == LFUN_CHAR_RIGHT_SELECT); - next_cell = (isRightToLeft(cur) != right); + bool const right = cmd.action == LFUN_CHAR_RIGHT + || cmd.action == LFUN_CHAR_RIGHT_SELECT + || cmd.action == LFUN_WORD_RIGHT + || cmd.action == LFUN_WORD_RIGHT_SELECT; + next_cell = isRightToLeft(cur) != right; if (lyxrc.visual_cursor) { entry_from = right ? ENTRY_DIRECTION_LEFT:ENTRY_DIRECTION_RIGHT; @@ -3451,10 +3465,14 @@ void InsetTabular::doDispatch(Cursor & cur, FuncRequest & cmd) finish_lfun = LFUN_FINISHED_LEFT; } - bool const select = cmd.action == LFUN_CHAR_FORWARD_SELECT || - cmd.action == LFUN_CHAR_BACKWARD_SELECT || - cmd.action == LFUN_CHAR_RIGHT_SELECT || - cmd.action == LFUN_CHAR_LEFT_SELECT; + bool const select = cmd.action == LFUN_CHAR_FORWARD_SELECT + || cmd.action == LFUN_CHAR_BACKWARD_SELECT + || cmd.action == LFUN_CHAR_RIGHT_SELECT + || cmd.action == LFUN_CHAR_LEFT_SELECT + || cmd.action == LFUN_WORD_FORWARD_SELECT + || cmd.action == LFUN_WORD_RIGHT_SELECT + || cmd.action == LFUN_WORD_BACKWARD_SELECT + || cmd.action == LFUN_WORD_LEFT_SELECT; // If we have a multicell selection or we're // not doing some LFUN_*_SELECT thing anyway... diff --git a/status.16x b/status.16x index 421a81555d..ef06e5d21a 100644 --- a/status.16x +++ b/status.16x @@ -35,6 +35,8 @@ What's new + Utilize read-only checkouts with "cvs edit". + Check for conflicts when doing checkIn/checkOut operation. +- Allow Ctrl+Arrow to move between table cells (bug 1839). + * DOCUMENTATION AND LOCALIZATION