\backslash vs \textbackslash

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5067 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-08-22 07:49:53 +00:00
parent b9beccdc65
commit 9ed34a5419

View File

@ -1159,7 +1159,7 @@ bool MathCursor::script(bool up)
// Hack to get \\^ and \\_ working // Hack to get \\^ and \\_ working
if (inMacroMode() && macroName() == "\\") { if (inMacroMode() && macroName() == "\\") {
if (up) if (up)
interpret("\\mathcircumflex"); niceInsert(createMathInset("mathcircumflex"));
else else
interpret('_'); interpret('_');
return true; return true;
@ -1219,12 +1219,6 @@ bool MathCursor::interpret(char c)
string name = macroName(); string name = macroName();
//lyxerr << "interpret name: '" << name << "'\n"; //lyxerr << "interpret name: '" << name << "'\n";
if (name.empty() && c == '\\') {
backspace();
interpret("\\backslash");
return true;
}
if (isalpha(c)) { if (isalpha(c)) {
activeMacro()->setName(activeMacro()->name() + c); activeMacro()->setName(activeMacro()->name() + c);
return true; return true;
@ -1234,10 +1228,13 @@ bool MathCursor::interpret(char c)
if (name == "\\") { if (name == "\\") {
// remove the '\\' // remove the '\\'
backspace(); backspace();
if (c == '\\') if (c == '\\') {
interpret("\\backslash"); if (currentMode() == MathInset::TEXT_MODE)
niceInsert(createMathInset("textbackslash"));
else else
interpret(string("\\") + c); niceInsert(createMathInset("backslash"));
} else
niceInsert(createMathInset(string(1, c)));
return true; return true;
} }