]> git.lyx.org Git - features.git/commitdiff
Fix bug 4687
authorEnrico Forestieri <forenr@lyx.org>
Thu, 19 Jun 2008 09:16:05 +0000 (09:16 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Thu, 19 Jun 2008 09:16:05 +0000 (09:16 +0000)
http://bugzilla.lyx.org/show_bug.cgi?id=4687

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

src/mathed/MathMacro.cpp

index 2c9aff1f0d6e3f03ab1f3a26a4cd3390a6f2842e..eb9bad424d8c4baac7d4f0bb17dedc386e103374 100644 (file)
@@ -32,8 +32,9 @@
 
 #include "frontends/Painter.h"
 
-#include "support/lassert.h"
 #include "support/debug.h"
+#include "support/lassert.h"
+#include "support/textutils.h"
 
 #include <ostream>
 #include <vector>
@@ -132,10 +133,11 @@ Inset * MathMacro::clone() const
 
 docstring MathMacro::name() const
 {
-       if (displayMode_ == DISPLAY_UNFOLDED)
+       if (displayMode_ == DISPLAY_UNFOLDED
+           && (name_.size() > 1 || (name_[0] != '_' && name_[0] != '^')))
                return asString(cell(0));
-       else
-               return name_;
+
+       return name_;
 }
 
 
@@ -660,7 +662,8 @@ void MathMacro::write(WriteStream & os) const
        // non-normal mode
        if (displayMode_ != DISPLAY_NORMAL) {
                os << "\\" << name();
-               os.pendingSpace(true);
+               if (name().size() != 1 || isAlphaASCII(name()[0]))
+                       os.pendingSpace(true);
                return;
        }