+ int y = getPos(cur, cur.boundary()).y_;
+ int const ymax = y + height_ - defaultRowHeight();
+ while (y < ymax && cur.down())
+ y = getPos(cur, cur.boundary()).y_;
+
+ cur.finishUndo();
+ processUpdateFlags(Update::SinglePar | Update::FitCursor);
+ break;
+ }
+
+ case LFUN_BRANCH_ACTIVATE:
+ case LFUN_BRANCH_DEACTIVATE:
+ buffer_.dispatch(cmd);
+ processUpdateFlags(Update::Force);
+ break;
+
+ // These two could be rewriten using some command like forall <insetname> <command>
+ // once the insets refactoring is done.
+ case LFUN_GRAPHICS_GROUPS_UNIFY: {
+ if (cmd.argument().empty())
+ break;
+ //view()->cursor().recordUndoFullDocument(); let inset-apply do that job
+ graphics::unifyGraphicsGroups(cur.buffer(), to_utf8(cmd.argument()));
+ processUpdateFlags(Update::Force | Update::FitCursor);
+ break;
+ }
+
+ case LFUN_NOTES_MUTATE: {
+ if (cmd.argument().empty())
+ break;
+ cur.recordUndoFullDocument();
+
+ if (mutateNotes(cur, cmd.getArg(0), cmd.getArg(1))) {
+ processUpdateFlags(Update::Force);
+ }
+ break;
+ }
+
+ case LFUN_ALL_INSETS_TOGGLE: {
+ string action;
+ string const name = split(to_utf8(cmd.argument()), action, ' ');
+ InsetCode const inset_code = insetCode(name);
+
+ FuncRequest fr(LFUN_INSET_TOGGLE, action);
+
+ Inset & inset = cur.buffer().inset();
+ InsetIterator it = inset_iterator_begin(inset);
+ InsetIterator const end = inset_iterator_end(inset);
+ for (; it != end; ++it) {
+ if (it->asInsetCollapsable()
+ && (inset_code == NO_CODE
+ || inset_code == it->lyxCode())) {
+ Cursor tmpcur = cur;
+ tmpcur.pushBackward(*it);
+ it->dispatch(tmpcur, fr);
+ }
+ }
+ processUpdateFlags(Update::Force | Update::FitCursor);