if (!cur.mark())
cur.clearSelection();
finishChange(bv, false);
- if (cursorPar() == firstPar() && cursorRow() == firstRow())
+ if (cur.par() == 0 && cursorRow() == firstRow())
return DispatchResult(false, FINISHED_UP);
cursorPrevious();
break;
if (!cur.mark())
cur.clearSelection();
finishChange(bv, false);
- if (cursorPar() == lastPar() && cursorRow() == lastRow())
+ if (cur.par() == cur.lastpar() && cursorRow() == lastRow())
return DispatchResult(false, FINISHED_DOWN);
cursorNext();
break;
break;
case LFUN_PASTE:
- cmd.message(_("Paste"));
+ cur.message(_("Paste"));
replaceSelection(bv->getLyXText());
#warning FIXME Check if the arg is in the domain of available selections.
if (isStrUnsignedInt(cmd.argument))
case LFUN_CUT:
cutSelection(true, true);
- cmd.message(_("Cut"));
+ cur.message(_("Cut"));
bv->update();
break;
case LFUN_COPY:
copySelection();
- cmd.message(_("Copy"));
+ cur.message(_("Copy"));
break;
case LFUN_BEGINNINGBUFSEL:
break;
case LFUN_GETXY:
- cmd.message(tostr(cursorX(cur.current())) + ' '
+ cur.message(tostr(cursorX(cur.current())) + ' '
+ tostr(cursorY(cur.current())));
break;
case LFUN_GETFONT:
if (current_font.shape() == LyXFont::ITALIC_SHAPE)
- cmd.message("E");
+ cur.message("E");
else if (current_font.shape() == LyXFont::SMALLCAPS_SHAPE)
- cmd.message("N");
+ cur.message("N");
else
- cmd.message("0");
+ cur.message("0");
break;
case LFUN_GETLAYOUT:
- cmd.message(cursorPar()->layout()->name());
+ cur.message(cursorPar()->layout()->name());
break;
case LFUN_LAYOUT: {
// function list/array with information about what
// functions needs arguments and their type.
if (cmd.argument.empty()) {
- cmd.errorMessage(_("LyX function 'layout' needs an argument."));
+ cur.errorMessage(_("LyX function 'layout' needs an argument."));
break;
}
}
if (!hasLayout) {
- cmd.errorMessage(string(N_("Layout ")) + cmd.argument +
+ cur.errorMessage(string(N_("Layout ")) + cmd.argument +
N_(" not known"));
break;
}
break;
case LFUN_FINISHED_LEFT:
- lyxerr << "swallow LFUN_FINISHED_LEFT" << endl;
+ lyxerr << "handle LFUN_FINISHED_LEFT" << endl;
+ cur.pop(cur.currentDepth());
+ cur.bv().cursor() = cur;
if (rtl())
cursorLeft(true);
break;
case LFUN_FINISHED_RIGHT:
- lyxerr << "swallow LFUN_FINISHED_RIGHT" << endl;
+ lyxerr << "handle LFUN_FINISHED_RIGHT" << endl;
+ cur.pop(cur.currentDepth());
+ cur.bv().cursor() = cur;
if (!rtl())
cursorRight(true);
break;
case LFUN_FINISHED_UP:
- lyxerr << "swallow LFUN_FINISHED_UP" << endl;
+ lyxerr << "handle LFUN_FINISHED_UP" << endl;
+ cur.pop(cur.currentDepth());
+ cur.bv().cursor() = cur;
cursorUp(true);
break;
case LFUN_FINISHED_DOWN:
- lyxerr << "swallow LFUN_FINISHED_DOWN" << endl;
+ lyxerr << "handle LFUN_FINISHED_DOWN" << endl;
+ cur.pop(cur.currentDepth());
+ cur.bv().cursor() = cur;
cursorDown(true);
break;