dispatch(FuncRequest(LFUN_SELF_INSERT, arg,
FuncRequest::KEYBOARD));
LYXERR(Debug::KEY, "SelfInsert arg[`" << to_utf8(arg) << "']");
- lyx_view_->updateCompletion(true, true);
}
} else {
dispatch(func);
if (!lyx_view_)
return;
- if (func.action == LFUN_CHAR_DELETE_BACKWARD)
- // backspace is not a self-insertion. But it
- // still should not hide the completion popup.
- // FIXME: more clever way to detect those movements
- lyx_view_->updateCompletion(false, true);
- else
- lyx_view_->updateCompletion(false, false);
}
if (lyx_view_)
case LFUN_BUFFER_PARAMS_APPLY: {
BOOST_ASSERT(lyx_view_);
- biblio::CiteEngine const oldEngine =
- lyx_view_->buffer()->params().getEngine();
Buffer * buffer = lyx_view_->buffer();
-
DocumentClass * oldClass = buffer->params().documentClassPtr();
-
Cursor & cur = view()->cursor();
cur.recordUndoFullDocument();
updateLayout(oldClass, buffer);
- biblio::CiteEngine const newEngine =
- lyx_view_->buffer()->params().getEngine();
-
- if (oldEngine != newEngine) {
- FuncRequest fr(LFUN_INSET_REFRESH);
-
- Inset & inset = lyx_view_->buffer()->inset();
- InsetIterator it = inset_iterator_begin(inset);
- InsetIterator const end = inset_iterator_end(inset);
- for (; it != end; ++it)
- if (it->lyxCode() == CITE_CODE)
- it->dispatch(cur, fr);
- }
-
updateFlags = Update::Force | Update::FitCursor;
- // We are here most certainaly because of a change in the document
- // It is then better to make sure that all dialogs are in sync
- // with current document settings. LyXView::restartCursor() achieve this.
+ // We are most certainly here because of a change in the document
+ // It is then better to make sure that all dialogs are in sync with
+ // current document settings. LyXView::restartCursor() achieve this.
lyx_view_->restartCursor();
break;
}
view()->cursor().fixIfBroken();
}
+ // update completion. We do it here and not in
+ // processKeySym to avoid another redraw just for a
+ // changed inline completion
+ if (cmd.origin == FuncRequest::KEYBOARD) {
+ if (cmd.action == LFUN_SELF_INSERT)
+ lyx_view_->updateCompletion(view()->cursor(), true, true);
+ else if (cmd.action == LFUN_CHAR_DELETE_BACKWARD)
+ lyx_view_->updateCompletion(view()->cursor(), false, true);
+ else
+ lyx_view_->updateCompletion(view()->cursor(), false, false);
+ }
+
updateFlags = view()->cursor().result().update();
}