Generalize control on double blank lines.

We can now tell whether a blank line was just output and so can
avoid outputting another one.
This commit is contained in:
Enrico Forestieri 2014-05-20 21:52:29 +02:00
parent fc19148f6d
commit 7145863466
2 changed files with 5 additions and 3 deletions

View File

@ -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();

View File

@ -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();