From 1ad3f809a43121a29c3d9e4648cdf49c0e1bc315 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 18 May 2014 23:02:24 +0200 Subject: [PATCH] Prettify the output of InsetSeparator. If a separator inset is used after an environment with NextNoIndent set to false, a blank line was already output. So, avoid outputting another blank line or an odd looking line with only a '%' character (as the previous blank line provides already a visual separation). --- src/insets/InsetSeparator.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/insets/InsetSeparator.cpp b/src/insets/InsetSeparator.cpp index ba98552079..eaf376f15e 100644 --- a/src/insets/InsetSeparator.cpp +++ b/src/insets/InsetSeparator.cpp @@ -139,16 +139,19 @@ ColorCode InsetSeparator::ColorName() const void InsetSeparator::latex(otexstream & os, OutputParams const &) const { - switch (params_.kind) { - case InsetSeparatorParams::PLAIN: - os << breakln << "%\n"; - break; - case InsetSeparatorParams::PARBREAK: - os << breakln << "\n"; - break; - default: - os << breakln << "%\n"; - break; + // Do nothing if a paragraph break was just output + if (!os.afterParbreak()) { + switch (params_.kind) { + case InsetSeparatorParams::PLAIN: + os << breakln << "%\n"; + break; + case InsetSeparatorParams::PARBREAK: + os << breakln << "\n"; + break; + default: + os << breakln << "%\n"; + break; + } } } -- 2.39.2