element (like {a'}^{2}). (froward port from 14802)
* src/mathed/math_nestinset.C (script): when creating a script
inset, handle specially previous atom if it is a MathBraceInset
(this is used in interactive input).
* src/mathed/math_parser.C (parse1): when creating a script inset,
handle specially previous atom if it is a MathBraceInset (this is
used in parsing phase).
* src/mathed/math_scriptinset.C (write): put nucleus into braces
if it contains more than one element or is itself a script inset.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14819
a592a061-630c-0410-9148-
cb99ea01b6c8
}
--cur.pos();
MathScriptInset * inset = cur.nextAtom().nucleus()->asScriptInset();
+ // special handling of {}-bases
+ // is this always correct?
+ if (inset->nuc().size() == 1
+ && inset->nuc().back()->asBraceInset())
+ inset->nuc() = inset->nuc().back()->asNestInset()->cell(0);
+
cur.push(*inset);
cur.idx() = 1;
cur.pos() = 0;
MathScriptInset * p = cell->back().nucleus()->asScriptInset();
// special handling of {}-bases
// is this always correct?
- // It appears that this is wrong (Dekel)
- //if (p->nuc().size() == 1 && p->nuc().back()->asNestInset() &&
- // p->nuc().back()->extraBraces())
- // p->nuc() = p->nuc().back()->asNestInset()->cell(0);
+ if (p->nuc().size() == 1
+ && p->nuc().back()->asBraceInset())
+ p->nuc() = p->nuc().back()->asNestInset()->cell(0);
parse(p->cell(p->idxOfScript(up)), FLAG_ITEM, mode);
if (limits) {
p->limits(limits);
void MathScriptInset::write(WriteStream & os) const
{
if (nuc().size()) {
- os << nuc();
+ if (nuc().size() == 1
+ && ! nuc().begin()->nucleus()->asScriptInset())
+ os << nuc();
+ else
+ os << '{' << nuc() << '}';
//if (nuc().back()->takesLimits()) {
if (limits_ == -1)
os << "\\nolimits ";