From 69bd59cc8b0ea1f79e3cbfea3078dd1275f4a674 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 3 Jun 2008 00:09:20 +0000 Subject: [PATCH] Be sure to insert a space after a macro when needed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25088 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/InsetMathString.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mathed/InsetMathString.cpp b/src/mathed/InsetMathString.cpp index 657e29a56a..a8eb1067c3 100644 --- a/src/mathed/InsetMathString.cpp +++ b/src/mathed/InsetMathString.cpp @@ -17,6 +17,8 @@ #include "Encoding.h" #include "support/gettext.h" +#include "support/lstrings.h" +#include "support/textutils.h" namespace lyx { @@ -127,6 +129,11 @@ void InsetMathString::write(WriteStream & os) const } os << command; } + // We may need a space if the command contains a macro + // and the last char is ASCII. + if (lyx::support::contains(command, '\\') + && isAlphaASCII(command[command.size() - 1])) + os.pendingSpace(true); } catch (EncodingException & e) { if (os.dryrun()) { // FIXME: this is OK for View->Source -- 2.39.2