}
-int InsetMathNest::latex(odocstream & os, OutputParams const & runparams) const
+int InsetMathNest::latex(otexstream & os, OutputParams const & runparams) const
{
- WriteStream wi(os, runparams.moving_arg, true,
+ WriteStream wi(os.os(), runparams.moving_arg, true,
runparams.dryrun ? WriteStream::wsDryrun : WriteStream::wsDefault,
runparams.encoding);
+ wi.canBreakLine(os.canBreakLine());
write(wi);
+ os.canBreakLine(wi.canBreakLine());
return wi.line();
}
if (have_l)
cur.insert(MathAtom(new InsetMathBig(lname,
ldelim)));
- cur.niceInsert(selection);
- if (have_r)
+ // first insert the right delimiter and then go back
+ // and re-insert the selection (bug 7088)
+ if (have_r) {
cur.insert(MathAtom(new InsetMathBig(rname,
rdelim)));
+ cur.posBackward();
+ }
+ cur.niceInsert(selection);
}
// Don't call cur.undispatched() if we did nothing, this would
// lead to infinite recursion via Text::dispatch().
break;
}
+ case LFUN_MATH_MODE:
+ // forbid "math-mode on" in math mode to prevent irritating
+ // behaviour of menu entries (bug 6709)
+ flag.setEnabled(currentMode() == TEXT_MODE || arg != "on");
+ break;
+
case LFUN_MATH_INSERT:
flag.setEnabled(currentMode() != TEXT_MODE);
break;