]> git.lyx.org Git - features.git/commitdiff
Be sure to insert a space after a macro when needed.
authorEnrico Forestieri <forenr@lyx.org>
Tue, 3 Jun 2008 00:09:20 +0000 (00:09 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 3 Jun 2008 00:09:20 +0000 (00:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25088 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/InsetMathString.cpp

index 657e29a56aadb734a0314b47504abbae15230e38..a8eb1067c3d509a5c7ce9a7cab22859710b0f314 100644 (file)
@@ -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