Le 16 nov. 10 à 01:09, Enrico Forestieri a écrit :
On Tue, Nov 16, 2010 at 12:01:59AM +0100, Jean-Marc Lasgouttes wrote:
Le 15 nov. 10 à 23:48, Enrico Forestieri a écrit :
See attached patch. This solves the problem of the extra line after
\end{split}, but the code should be audited for other occurrences
of extra newlines.

I think we could also use this method for properly ending math
environments on a new line (i.e., y=x\] vs y=x\n\]) without fear
of introducing spurious empty lines.

The attached patch achieves that goal. All closing \end{mathenv}
environments now occur at the beginning of a line without risk of
empty lines.


One comment should be changed below:
+       /// writes newline if next thing doesn't already begin with a newline
+       void pendingNewline(bool newline);
+       /// writes newline if next thing doesn't already begin with a newline
+       bool pendingNewline() const { return pendingnewline_; }

It might be worth to define a processNewline(char) method to avoid the duplicated
code like
+       if (ws.pendingNewline() && c != '\n') {
+               ws.os() << '\n';
+               ws.addlines(1);
+       }
+       ws.pendingNewline(false);

JMarc

Reply via email to