]> git.lyx.org Git - features.git/commitdiff
Fix tex2lyx parsing of consecutive hyphens
authorGeorg Baum <baum@lyx.org>
Sun, 1 Feb 2015 13:03:58 +0000 (14:03 +0100)
committerGeorg Baum <baum@lyx.org>
Sun, 1 Feb 2015 13:03:58 +0000 (14:03 +0100)
tex2lyx was already behaving as if bug #3647 was fixed, but currently -- and
--- have the same special meaning in LyX as in LaTeX.

src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-insets.tex
src/tex2lyx/text.cpp

index fb0d5566469018119866b88abe10a01596e70454..cfdb976a5cd6208b98c4a9692ec9db3b41224a0e 100644 (file)
@@ -6768,6 +6768,70 @@ and a spif\SpecialChar \textcompwordmark{}
 fy ligature break.
 \end_layout
 
+\begin_layout Standard
+There are dashes: endash in short form -- and long form –, emdash is alike: --- and —. If we really want several hyphens in a row, we need to separate them: -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+-, -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+-, -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Plain Layout
+{}
+\end_layout
+
+\end_inset
+
+- etc.
+\end_layout
+
 \begin_layout Standard
 
 \begin_inset ERT
index 162ebd843a8da38cd278c0519fca26c060fe72c6..028b970510b331d9f2213e7c14a944d771fb9106 100644 (file)
@@ -656,6 +656,10 @@ And what about special characters like hyphe\-nation mark,
 ellipsis\ldots, and end-of-sentence\@. LyX also supports a menu
 separator\lyxarrow{}and a spif\textcompwordmark{}fy ligature break.
 
+There are dashes: endash in short form -- and long form \textendash,
+emdash is alike: --- and \textemdash. If we really want several hyphens
+in a row, we need to separate them: -{}-, -{}-{}-, -{}-{}-{}- etc.
+
 LyX translates the phrases LyX, TeX, LaTeX2e and LaTeX
 to the commands \LyX{}, \TeX{}, \LaTeXe{} and \LaTeX{}.
 If these phrases occur as part of other words (like 1LyX or aTeX or LaTeX3)
index 9d75d7de58d056fef31254b17820dff484717eed..f2fe12def5dbe36ad70bfca283d103a82ed923e0 100644 (file)
@@ -2420,10 +2420,8 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                // {}
                                Token const prev = p.prev_token();
                                p.get_token();
-                               if (p.next_token().character() == '`' ||
-                                   (prev.character() == '-' &&
-                                    p.next_token().character() == '-'))
-                                       ; // ignore it in {}`` or -{}-
+                               if (p.next_token().character() == '`')
+                                       ; // ignore it in {}``
                                else
                                        output_ert_inset(os, "{}", context);
                        } else if (next.cat() == catEscape &&