case LFUN_FINISHED_BACKWARD:
case LFUN_FINISHED_FORWARD:
+ case LFUN_FINISHED_RIGHT:
+ case LFUN_FINISHED_LEFT:
//lyxerr << "action: " << cmd.action << endl;
InsetMathGrid::doDispatch(cur, cmd);
notifyCursorLeaves(cur);
InsetMathGrid::doDispatch(cur, cmd);
break;
- case LFUN_MATH_NUMBER: {
+ case LFUN_MATH_NUMBER_TOGGLE: {
//lyxerr << "toggling all numbers" << endl;
cur.recordUndoInset();
bool old = numberedType();
break;
}
- case LFUN_MATH_NONUMBER: {
+ case LFUN_MATH_NUMBER_LINE_TOGGLE: {
cur.recordUndoInset();
row_type r = (type_ == hullMultline) ? nrows() - 1 : cur.row();
bool old = numbered(r);
}
if (cur.pos() > cur.lastpos())
cur.pos() = cur.lastpos();
+
+ // FIXME: find some more clever handling of the selection,
+ // i.e. preserve it.
+ cur.clearSelection();
//cur.dispatched(FINISHED);
break;
}
switch (cmd.action) {
case LFUN_FINISHED_BACKWARD:
case LFUN_FINISHED_FORWARD:
+ case LFUN_FINISHED_RIGHT:
+ case LFUN_FINISHED_LEFT:
case LFUN_UP:
case LFUN_DOWN:
case LFUN_NEW_LINE:
// we handle these
status.enabled(true);
return true;
- case LFUN_MATH_NUMBER:
+ case LFUN_MATH_NUMBER_TOGGLE:
// FIXME: what is the right test, this or the one of
// LABEL_INSERT?
status.enabled(display());
status.setOnOff(numberedType());
return true;
- case LFUN_MATH_NONUMBER: {
+ case LFUN_MATH_NUMBER_LINE_TOGGLE: {
// FIXME: what is the right test, this or the one of
// LABEL_INSERT?
status.enabled(display());
}
-void InsetMathHull::edit(Cursor & cur, bool front)
+void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from)
{
cur.push(*this);
- front ? idxFirst(cur) : idxLast(cur);
+ bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT ||
+ (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front));
+ enter_front ? idxFirst(cur) : idxLast(cur);
// The inset formula dimension is not necessarily the same as the
// one of the instant preview image, so we have to indicate to the
// BufferView that a metrics update is needed.