int new_id = cur.paragraph().id();
// if bottom_pit, bottom_pos or top_id has been changed, update bookmark
- // see http://bugzilla.lyx.org/show_bug.cgi?id=3092
+ // see http://www.lyx.org/trac/ticket/3092
if (bm.bottom_pit != new_pit || bm.bottom_pos != new_pos
|| bm.top_id != new_id) {
const_cast<BookmarksSection::Bookmark &>(bm).updatePos(
return flag;
}
- switch (cmd.action) {
- case LFUN_UNKNOWN_ACTION:
+ if (cmd.action == LFUN_UNKNOWN_ACTION) {
flag.unknown(true);
flag.setEnabled(false);
- break;
-
- default:
- break;
- }
-
- if (flag.unknown()) {
flag.message(from_utf8(N_("Unknown action")));
return flag;
}
- if (!flag.enabled()) {
- if (flag.message().empty())
- flag.message(from_utf8(N_("Command disabled")));
- return flag;
- }
-
// I would really like to avoid having this switch and rather try to
// encode this in the function itself.
// -- And I'd rather let an inset decide which LFUNs it is willing
break;
}
- case LFUN_DROP_LAYOUTS_CHOICE:
case LFUN_CURSOR_FOLLOWS_SCROLLBAR_TOGGLE:
case LFUN_REPEAT:
case LFUN_PREFERENCES_SAVE:
- case LFUN_INSET_EDIT:
case LFUN_BUFFER_SAVE_AS_DEFAULT:
+ case LFUN_DEBUG_LEVEL_SET:
// these are handled in our dispatch()
break;
// FIXME: this LFUN should also work without any view.
Buffer * buffer = (lv && lv->documentBufferView())
? &(lv->documentBufferView()->buffer()) : 0;
- buffer = &lv->currentBufferView()->buffer();
- if (buffer && !theBufferList().isLoaded(buffer))
- buffer = 0;
if (buffer)
buffer->undo().beginUndoGroup();
while (!arg.empty()) {
func.origin = cmd.origin;
dispatch(func);
}
- if (buffer)
+ // the buffer may have been closed by one action
+ if (theBufferList().isLoaded(buffer))
buffer->undo().endUndoGroup();
break;
}
theSession().bookmarks().clear();
break;
+ case LFUN_DEBUG_LEVEL_SET:
+ lyxerr.setLevel(Debug::value(to_utf8(cmd.argument())));
+ break;
+
default:
DispatchResult dr;
}
}
- // Is this a function that acts on inset at point?
- Inset * inset = bv->cursor().nextInset();
- if (lyxaction.funcHasFlag(action, LyXAction::AtPoint)
- && inset) {
- bv->cursor().result().dispatched(true);
- bv->cursor().result().update(Update::FitCursor | Update::Force);
- FuncRequest tmpcmd = cmd;
- inset->dispatch(bv->cursor(), tmpcmd);
- if (bv->cursor().result().dispatched()) {
- updateFlags = bv->cursor().result().update();
- break;
- }
- }
-
// Let the current Cursor dispatch its own actions.
Cursor old = bv->cursor();
bv->cursor().getPos(cursorPosBeforeDispatchX_,
&& flag.enabled()
&& !lyxaction.funcHasFlag(action, LyXAction::NoBuffer)
&& !lyxaction.funcHasFlag(action, LyXAction::ReadOnly))
- doc_buffer->markDirty();
+ lv->currentBufferView()->buffer().markDirty();
if (lv && lv->currentBufferView()) {
// BufferView::update() updates the ViewMetricsInfo and