From: André Pönitz Date: Wed, 31 Oct 2001 15:14:22 +0000 (+0000) Subject: drop extra {} in "obvious" cases X-Git-Tag: 1.6.10~20411 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=48a3633de7f7d32aa76b6b7bc81230809238de5f;p=lyx.git drop extra {} in "obvious" cases git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2954 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/BUGS b/src/mathed/BUGS index bd9af09116..81bbe4122f 100644 --- a/src/mathed/BUGS +++ b/src/mathed/BUGS @@ -155,8 +155,8 @@ Marcus (Suran@gmx.net) - If the math-panel has the focus I can type text but not switch into math-mode or use some of the other keyboard-shortcuts. -- In the default-configuration there are shortcuts for al greek characters - _except_ varphi wich is used extensively as a default-variable-name. +// - In the default-configuration there are shortcuts for al greek characters +// _except_ varphi wich is used extensively as a default-variable-name. From: Álvaro Tejero Cantero @@ -206,8 +206,8 @@ From: majority of cases. -- undo-redo seems too coarse in math-mode. You end up losing substantial - fragments of your formula. I hate that when it affects tensors,;). +// - undo-redo seems too coarse in math-mode. You end up losing substantial +// fragments of your formula. I hate that when it affects tensors,;). - cut&paste inside math-mode doesn't work the X fashion (middle button doesn't paste anything). diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 7b74c6dda3..498daee1d2 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -724,8 +724,18 @@ void Parser::parse_into(MathArray & array, unsigned flags, MathTextCodes code) } else if (t.cat() == catBegin) { - array.push_back(MathAtom(new MathBraceInset)); - parse_into(array.back()->cell(0), FLAG_BRACE_LAST); + MathArray ar; + parse_into(ar, FLAG_BRACE_LAST); +#ifndef WITH_WARNINGS +#warning this might be wrong in general! +#endif + // ignore braces around simple items + if (ar.size() == 1 || (ar.size() == 2 && ar.back()->asScriptInset())) { + array.push_back(ar); + } else { + array.push_back(MathAtom(new MathBraceInset)); + array.back()->cell(0).swap(ar); + } } else if (t.cat() == catEnd) { diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index d8eed93949..a66ec9c676 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -278,7 +278,7 @@ void MathScriptInset::writeNormal(MathInset const * nuc, ostream & os) const if (u && d) { os << "[sup [sub " << osb.str() << " "; down().data_.writeNormal(os); - os << "]"; + os << "] "; up().data_.writeNormal(os); os << ']'; } else if (u) {