From a7a1a1d022abcb6519dd23fe80ef8e3c76889976 Mon Sep 17 00:00:00 2001 From: Sam Liddicott Date: Wed, 18 Nov 2009 12:24:17 +0000 Subject: [PATCH] Emit #line more eagerly empty text chunklets after a newline were being treated as a valid reason not to emit a #line pragma This was needlessly causing #line to be emitted in the middle of multiline #defines at the top of an included chunk or in the middle of a function parameter list. This fix doesn't prevent such bad behaviour (which depends on mode tracking) but it does prevent it occuring needlessly --- newfangle | 2 +- newfangle.lyx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/newfangle b/newfangle index fcfe26b..88fce2f 100644 --- a/newfangle +++ b/newfangle @@ -215,7 +215,7 @@ function write_chunk(chunk_name, indent, tail, } else { newline = 1; } - } else { + } else if (length(text) || length(tail)) { if (newline) text = indent text; newline = 0; } diff --git a/newfangle.lyx b/newfangle.lyx index 9e189bc..dbc9a07 100644 --- a/newfangle.lyx +++ b/newfangle.lyx @@ -247,6 +247,11 @@ when a parameterized chunk is included as well as the #line emission, say what the paremeters were for that invocation. \end_layout +\begin_layout Enumerate +with 2 macro expansions on one line ${} ${} the first is too greedy and + looks to the wrong } +\end_layout + \begin_layout Chapter* License \end_layout @@ -8479,7 +8484,7 @@ status open \begin_layout Plain Layout - } else { + } else if (length(text) || length(tail)) { \end_layout \begin_layout Plain Layout -- 2.11.4.GIT