From: Georg Baum Date: Fri, 27 Feb 2015 21:06:11 +0000 (+0100) Subject: Fix \nobreakdash- roundtrip in moving args X-Git-Tag: 2.2.0alpha1~1257 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e76fc730406ec4d70949427bc7c4c5b146f72e98;p=features.git Fix \nobreakdash- roundtrip in moving args Previously, tex2lyx did not remove the \protect which is output by LyX in front of \nobreakdash- if needed. Now tex2lyx removes it unconditionally (like it does elsewhere), because LyX will add it if needed. --- diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index ce0443b7aa..869fac9d82 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -3818,7 +3818,12 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } else if ((t.cs() == "nobreakdash" && p.next_token().asInput() == "-") || + (t.cs() == "protect" && p.next_token().asInput() == "\\nobreakdash" && + p.next_next_token().asInput() == "-") || (t.cs() == "@" && p.next_token().asInput() == ".")) { + // LyX sometimes puts a \protect in front, so we have to ignore it + if (t.cs() == "protect") + p.get_token(); context.check_layout(os); os << "\\SpecialChar \\" << t.cs() << p.get_token().asInput() << '\n';