if (!inset)
return false;
+ if (InsetCollapsable * ci = inset->asInsetCollapsable())
+ ci->setLayout(cur.bv().buffer().params());
+
cur.recordUndo();
if (cmd.action == LFUN_INDEX_INSERT) {
docstring ds = support::subst(text->getStringToIndex(cur), '\n', ' ');
needsUpdate |= tm.cursorEnd(cur);
break;
+ case LFUN_WORD_RIGHT:
+ case LFUN_WORD_RIGHT_SELECT:
+ //FIXME: for visual cursor mode, really move right
+ if (reverseDirectionNeeded(cur)) {
+ lyx::dispatch(FuncRequest(
+ cmd.action == LFUN_WORD_RIGHT_SELECT ?
+ LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD));
+ } else {
+ lyx::dispatch(FuncRequest(
+ cmd.action == LFUN_WORD_RIGHT_SELECT ?
+ LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD));
+ }
+ break;
+
case LFUN_WORD_FORWARD:
case LFUN_WORD_FORWARD_SELECT:
needsUpdate |= cur.selHandle(cmd.action == LFUN_WORD_FORWARD_SELECT);
- if (reverseDirectionNeeded(cur))
- needsUpdate |= cursorLeftOneWord(cur);
- else
- needsUpdate |= cursorRightOneWord(cur);
+ needsUpdate |= cursorForwardOneWord(cur);
+ break;
+
+ case LFUN_WORD_LEFT:
+ case LFUN_WORD_LEFT_SELECT:
+ //FIXME: for visual cursor mode, really move left
+ if (reverseDirectionNeeded(cur)) {
+ lyx::dispatch(FuncRequest(
+ cmd.action == LFUN_WORD_LEFT_SELECT ?
+ LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD));
+ } else {
+ lyx::dispatch(FuncRequest(
+ cmd.action == LFUN_WORD_LEFT_SELECT ?
+ LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD));
+ }
break;
case LFUN_WORD_BACKWARD:
case LFUN_WORD_BACKWARD_SELECT:
needsUpdate |= cur.selHandle(cmd.action == LFUN_WORD_BACKWARD_SELECT);
- if (reverseDirectionNeeded(cur))
- needsUpdate |= cursorRightOneWord(cur);
- else
- needsUpdate |= cursorLeftOneWord(cur);
+ needsUpdate |= cursorBackwardOneWord(cur);
break;
case LFUN_WORD_SELECT: {
case LFUN_THEOREM_INSERT:
#endif
case LFUN_CAPTION_INSERT:
+ case LFUN_FOOTNOTE_INSERT:
// Open the inset, and move the current selection
// inside it.
doInsertInset(cur, this, cmd, true, true);
cur.posRight();
+ // These insets are numbered.
updateLabels(bv->buffer());
break;
case LFUN_NOTE_INSERT:
case LFUN_BIBITEM_INSERT:
case LFUN_ERT_INSERT:
case LFUN_LISTING_INSERT:
- case LFUN_FOOTNOTE_INSERT:
case LFUN_MARGINALNOTE_INSERT:
case LFUN_OPTIONAL_INSERT:
case LFUN_ENVIRONMENT_INSERT:
int const nargs = s1.empty() ? 0 : convert<int>(s1);
string const s2 = token(s, ' ', 2);
string const type = s2.empty() ? "newcommand" : s2;
- cur.insert(new MathMacroTemplate(from_utf8(token(s, ' ', 0)), nargs, from_utf8(type)));
+ cur.insert(new MathMacroTemplate(from_utf8(token(s, ' ', 0)), nargs, false, from_utf8(type)));
//cur.nextInset()->edit(cur, true);
}
break;
toggleall = toggle;
toggleAndShow(cur, this, freefont, toggleall);
cur.message(_("Character set"));
+ } else {
+ lyxerr << "Argument not ok";
}
break;
}
case LFUN_LINE_DELETE:
case LFUN_WORD_FORWARD:
case LFUN_WORD_BACKWARD:
+ case LFUN_WORD_RIGHT:
+ case LFUN_WORD_LEFT:
case LFUN_CHAR_FORWARD:
case LFUN_CHAR_FORWARD_SELECT:
case LFUN_CHAR_BACKWARD:
case LFUN_LINE_END_SELECT:
case LFUN_WORD_FORWARD_SELECT:
case LFUN_WORD_BACKWARD_SELECT:
+ case LFUN_WORD_RIGHT_SELECT:
+ case LFUN_WORD_LEFT_SELECT:
case LFUN_WORD_SELECT:
case LFUN_PARAGRAPH_UP:
case LFUN_PARAGRAPH_DOWN: