]> git.lyx.org Git - features.git/commitdiff
Better fix for bug #6270. The outer braces are swallowed only for user
authorEnrico Forestieri <forenr@lyx.org>
Thu, 29 Oct 2009 13:24:02 +0000 (13:24 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 29 Oct 2009 13:24:02 +0000 (13:24 +0000)
defined macros, so better use a brace inset only when strictly needed.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31789 a592a061-630c-0410-9148-cb99ea01b6c8

src/Cursor.cpp

index eedc70725dcdbf2eee05d4ce0ab415acbf56cd24..6353e43cabc189412a7051b255fb867dc965ef0d 100644 (file)
@@ -1423,8 +1423,7 @@ bool Cursor::macroModeClose()
        InsetMathUnknown * p = activeMacro();
        p->finalize();
        MathData selection;
-       // enclose selection in braces (bug #6270)
-       asArray('{' + p->selection() + '}', selection);
+       asArray(p->selection(), selection);
        docstring const s = p->name();
        --pos();
        cell().erase(pos());
@@ -1467,7 +1466,7 @@ bool Cursor::macroModeClose()
 
        // finally put the macro argument behind, if needed
        if (macroArg) {
-               if (selection.size() > 1)
+               if (selection.size() > 1 || selection[0]->asScriptInset())
                        plainInsert(MathAtom(new InsetMathBrace(selection)));
                else
                        insert(selection);