commit 7145863466c38080db9bdfba6ee7bb7583ffb862
Author: Enrico Forestieri <for...@lyx.org>
Date:   Tue May 20 21:52:29 2014 +0200

    Generalize control on double blank lines.
    
    We can now tell whether a blank line was just output and so can
    avoid outputting another one.

diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 2b6b9a3..12615e6 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -402,6 +402,8 @@ void InsetMathNest::latex(otexstream & os, OutputParams 
const & runparams) const
                       runparams.encoding);
        wi.canBreakLine(os.canBreakLine());
        write(wi);
+       // Reset parbreak status after a math inset.
+       os.lastChar(0);
        os.canBreakLine(wi.canBreakLine());
 
        int lf = wi.line();
diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 1f47ca7..7995f65 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -856,7 +856,7 @@ void TeXOnePar(Buffer const & buf,
        case LATEX_LIST_ENVIRONMENT:
                if (nextpar
                    && (par.params().depth() < nextpar->params().depth())
-                   && !par.isEnvSeparator(par.size() - 1))
+                   && !os.afterParbreak())
                        pending_newline = true;
                break;
        case LATEX_ENVIRONMENT: {
@@ -872,7 +872,7 @@ void TeXOnePar(Buffer const & buf,
        default:
                // we don't need it for the last paragraph!!!
                // or if the last thing is an environment separator
-               if (nextpar && par.size() > 0 && !par.isEnvSeparator(par.size() 
- 1))
+               if (nextpar && !os.afterParbreak())
                        pending_newline = true;
        }
 
@@ -1018,7 +1018,7 @@ void TeXOnePar(Buffer const & buf,
        // we don't need a newline for the last paragraph!!!
        // Note from JMarc: we will re-add a \n explicitly in
        // TeXEnvironment, because it is needed in this case
-       if (nextpar && par.size() > 0 && !par.isEnvSeparator(par.size() - 1)) {
+       if (nextpar && !os.afterParbreak()) {
                // Make sure to start a new line
                os << breakln;
                Layout const & next_layout = nextpar->layout();

Reply via email to