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
This commit is contained in:
Enrico Forestieri 2008-06-03 00:09:20 +00:00
parent 66799e41fd
commit 69bd59cc8b

View 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