splitCell(cur);
break;
- case LFUN_CELL_BACKWARD:
- // See below.
- cur.selection(false);
- if (!idxPrev(cur)) {
- cmd = FuncRequest(LFUN_FINISHED_BACKWARD);
- cur.undispatched();
- }
- break;
-
- case LFUN_CELL_FORWARD:
- // Can't handle selection by additional 'shift' as this is
- // hard bound to LFUN_CELL_BACKWARD
- cur.selection(false);
- if (!idxNext(cur)) {
- cmd = FuncRequest(LFUN_FINISHED_FORWARD);
- cur.undispatched();
- }
- break;
-
case LFUN_NEWLINE_INSERT: {
cur.recordUndoInset();
row_type const r = cur.row();
if (cur.idx() == 0)
return false;
--cur.idx();
- cur.pos() = cur.lastpos();
+ cur.pos() = lyxrc.mac_like_cursor_movement ? cur.lastpos() : 0;
return true;
}
case LFUN_CELL_FORWARD:
cur.screenUpdateFlags(Update::Decoration | Update::FitCursor);
- cur.inset().idxNext(cur);
+ cur.selHandle(false);
+ cur.clearTargetX();
+ cur.macroModeClose();
+ if (!cur.inset().idxNext(cur)) {
+ cur.idx() = firstIdx();
+ cur.pos() = 0;
+ }
break;
case LFUN_CELL_BACKWARD:
cur.screenUpdateFlags(Update::Decoration | Update::FitCursor);
- cur.inset().idxPrev(cur);
+ cur.selHandle(false);
+ cur.clearTargetX();
+ cur.macroModeClose();
+ if (!cur.inset().idxPrev(cur)) {
+ cur.idx() = lastIdx();
+ cur.pos() = lyxrc.mac_like_cursor_movement ? cur.lastpos() : 0;
+ }
break;
case LFUN_WORD_DELETE_BACKWARD: