}
-void doInsertInset(LCursor & cur, LyXText * text,
+bool doInsertInset(LCursor & cur, LyXText * text,
FuncRequest const & cmd, bool edit, bool pastesel)
{
InsetBase * inset = createInset(&cur.bv(), cmd);
if (!inset)
- return;
+ return false;
recordUndo(cur);
bool gotsel = false;
if (gotsel && pastesel)
cur.bv().owner()->dispatch(FuncRequest(LFUN_PASTE));
+ return true;
}
{
//we don't call update(true, false) directly to save a metrics call
if (cur.bv().fitCursor())
- cur.bv().update(false, true);
+ cur.bv().update(Update::Force);
}
cur.resetAnchor();
moveCursor(cur, false);
- // real_current_font.number can change so we need to
- // update the minibuffer
- if (old_font != real_current_font)
+ needsUpdate = redoParagraph(cur.pit());
+ if (!needsUpdate) {
+ // update only this paragraph
+ cur.bv().update(Update::SinglePar | Update::Force);
+ }
+
bv->updateScrollbar();
break;
}
case LFUN_INSET_FOOTNOTE:
case LFUN_INSET_MARGINAL:
case LFUN_INSET_OPTARG:
- case LFUN_TABULAR_INSERT:
case LFUN_ENVIRONMENT_INSERT:
// Open the inset, and move the current selection
// inside it.
cur.posRight();
break;
+ case LFUN_TABULAR_INSERT:
+ // if there were no arguments, just open the dialog
+ if (doInsertInset(cur, this, cmd, false, true))
+ cur.posRight();
+ else
+ bv->owner()->getDialogs().show("tabularcreate");
+
+ break;
+
case LFUN_INSET_FLOAT:
case LFUN_INSET_WIDE_FLOAT:
case LFUN_INSET_WRAP:
flag.setOnOff(cur.paragraph().params().startOfAppendix());
return true;
+ case LFUN_INSERT_BIBITEM:
+ enable = (cur.paragraph().layout()->labeltype == LABEL_BIBLIO);
+ break;
+
#if 0
// the functions which insert insets
InsetBase::Code code = InsetBase::NO_CODE;
case LFUN_INSERT_LABEL:
case LFUN_INSERT_NOTE:
case LFUN_INSERT_CHARSTYLE:
- case LFUN_INSERT_BIBITEM:
case LFUN_INSET_FLOAT:
case LFUN_INSET_FOOTNOTE:
case LFUN_INSET_MARGINAL: