mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
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:
parent
fc19148f6d
commit
7145863466
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user