#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/lyxtime.h"
+#include "support/os.h"
#include "mathed/InsetMathHull.h"
#include "mathed/MathMacroTemplate.h"
BufferView * bv = &cur.bv();
TextMetrics & tm = bv->textMetrics(this);
if (!tm.contains(cur.pit())) {
- lyx::dispatch(FuncRequest(LFUN_SCREEN_RECENTER));
+ lyx::dispatch(FuncRequest(LFUN_SCREEN_SHOW_CURSOR));
tm = bv->textMetrics(this);
}
pos_type pos = cur.pos();
BufferParams const & bufparams = bv->buffer().params();
Layout const & style = par.layout();
- if (!style.pass_thru
+ InsetLayout const & ilayout = cur.inset().getLayout(bufparams);
+ if (!style.pass_thru && !ilayout.isPassThru()
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
// this avoids a double undo
// FIXME: should not be needed, ideally
enable = cur.inset().insetAllowed(MATH_CODE);
break;
+ case LFUN_DATE_INSERT: {
+ string const format = cmd.argument().empty()
+ ? lyxrc.date_insert_format : to_utf8(cmd.argument());
+ enable = support::os::is_valid_strftime(format);
+ break;
+ }
+
case LFUN_WORD_DELETE_FORWARD:
case LFUN_WORD_DELETE_BACKWARD:
case LFUN_LINE_DELETE:
case LFUN_SERVER_SET_XY:
case LFUN_SERVER_GET_LAYOUT:
case LFUN_LAYOUT:
- case LFUN_DATE_INSERT:
case LFUN_SELF_INSERT:
case LFUN_LINE_INSERT:
case LFUN_MATH_DISPLAY: