FuncStatus flag;
Buffer * buf = owner->buffer();
+ if (action == LFUN_NOACTION) {
+ setStatusMessage(N_("Nothing to do"));
+ return flag.disabled(true);
+ }
+
if (action == LFUN_UNKNOWN_ACTION) {
setStatusMessage(N_("Unknown action"));
return flag.unknown(true);
case LFUN_MENU_SEPARATOR:
case LFUN_LDOTS:
case LFUN_END_OF_SENTENCE:
- case LFUN_PROTECTEDSPACE:
code = Inset::SPECIALCHAR_CODE;
break;
+ case LFUN_PROTECTEDSPACE:
+ // slight hack: we know this is allowed in math mode
+ if (!mathcursor)
+ code = Inset::SPECIALCHAR_CODE;
+ break;
default:
break;
}
if ((action > 1) || ((action == LFUN_UNKNOWN_ACTION) &&
(!keyseq.deleted())))
{
+ UpdatableInset * inset = owner->view()->theLockingInset();
+#if 1
+ int inset_x;
+ int dummy_y;
+ inset->getCursorPos(owner->view(), inset_x, dummy_y);
+#endif
if ((action == LFUN_UNKNOWN_ACTION)
&& argument.empty()) {
argument = keyseq.getiso();
} else if (action == LFUN_REDO) {
owner->view()->menuRedo();
goto exit_with_message;
- } else if (((result=owner->view()->theLockingInset()->
+ } else if (((result=inset->
// Hand-over to inset's own dispatch:
localDispatch(owner->view(), action, argument)) ==
UpdatableInset::DISPATCHED) ||
}
goto exit_with_message;
} else if (result == UpdatableInset::FINISHED_UP) {
- if (TEXT()->cursor.row()->previous()) {
+ if (TEXT()->cursor.irow()->previous()) {
+#if 1
+ TEXT()->setCursorFromCoordinates(
+ owner->view(), TEXT()->cursor.ix() + inset_x,
+ TEXT()->cursor.iy() -
+ TEXT()->cursor.irow()->baseline() - 1);
+ TEXT()->cursor.x_fix(TEXT()->cursor.x());
+#else
TEXT()->cursorUp(owner->view());
+#endif
moveCursorUpdate(true, false);
owner->showState();
+ } else {
+ owner->view()->update(TEXT(), BufferView::SELECT|BufferView::FITCUR);
}
goto exit_with_message;
} else if (result == UpdatableInset::FINISHED_DOWN) {
- if (TEXT()->cursor.row()->next())
+ if (TEXT()->cursor.irow()->next()) {
+#if 1
+ TEXT()->setCursorFromCoordinates(
+ owner->view(), TEXT()->cursor.ix() + inset_x,
+ TEXT()->cursor.iy() -
+ TEXT()->cursor.irow()->baseline() +
+ TEXT()->cursor.irow()->height() + 1);
+ TEXT()->cursor.x_fix(TEXT()->cursor.x());
+#else
TEXT()->cursorDown(owner->view());
- else
+#endif
+ } else {
TEXT()->cursorRight(owner->view());
+ }
moveCursorUpdate(true, false);
owner->showState();
goto exit_with_message;
- } else {
+ }
+#warning I am not sure this is still right, please have a look! (Jug 20020417)
+ else { // result == UNDISPATCHED
//setMessage(N_("Text mode"));
switch (action) {
case LFUN_UNKNOWN_ACTION:
true);
}
finishUndo();
+ // Tell the paragraph dialog that we changed paragraph
+ owner->getDialogs()->updateParagraph();
}
}
break;
<< id << "]" << endl;
break;
} else {
- lyxerr << "Paragraph " << par->id()
- << " found." << endl;
+ lyxerr[Debug::INFO] << "Paragraph " << par->id()
+ << " found." << endl;
}
if (owner->view()->theLockingInset())