From c691839abe2053a754a4e7599b1de106231bf347 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Thu, 19 Jun 2008 09:16:05 +0000 Subject: [PATCH] Fix bug 4687 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/mathed/MathMacro.cpp b/src/mathed/MathMacro.cpp index 2c9aff1f0d..eb9bad424d 100644 --- a/src/mathed/MathMacro.cpp +++ b/src/mathed/MathMacro.cpp @@ -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 #include @@ -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; } -- 2.39.2