version 1.211, 2013/12/22 23:34:13 |
version 1.212, 2013/12/23 02:20:09 |
Line 120 term_flushln(struct termp *p) |
|
Line 120 term_flushln(struct termp *p) |
|
* First, establish the maximum columns of "visible" content. |
* First, establish the maximum columns of "visible" content. |
* This is usually the difference between the right-margin and |
* This is usually the difference between the right-margin and |
* an indentation, but can be, for tagged lists or columns, a |
* an indentation, but can be, for tagged lists or columns, a |
* small set of values. |
* small set of values. |
|
* |
|
* The following unsigned-signed subtractions look strange, |
|
* but they are actually correct. If the int p->overstep |
|
* is negative, it gets sign extended. Subtracting that |
|
* very large size_t effectively adds a small number to dv. |
*/ |
*/ |
assert (p->rmargin >= p->offset); |
assert (p->rmargin >= p->offset); |
dv = p->rmargin - p->offset; |
dv = p->rmargin - p->offset; |
Line 199 term_flushln(struct termp *p) |
|
Line 204 term_flushln(struct termp *p) |
|
if (0 < ntab) |
if (0 < ntab) |
vbl += ntab * p->tabwidth; |
vbl += ntab * p->tabwidth; |
|
|
/* Remove the p->overstep width. */ |
/* |
|
* Remove the p->overstep width. |
|
* Again, if p->overstep is negative, |
|
* sign extension does the right thing. |
|
*/ |
|
|
bp += (size_t)p->overstep; |
bp += (size_t)p->overstep; |
p->overstep = 0; |
p->overstep = 0; |
Line 275 term_flushln(struct termp *p) |
|
Line 284 term_flushln(struct termp *p) |
|
* If we have overstepped the margin, temporarily move |
* If we have overstepped the margin, temporarily move |
* it to the right and flag the rest of the line to be |
* it to the right and flag the rest of the line to be |
* shorter. |
* shorter. |
|
* If there is a request to keep the columns together, |
|
* allow negative overstep when the column is not full. |
*/ |
*/ |
if (p->overstep < 0) |
if (p->trailspace && p->overstep < 0) |
p->overstep = 0; |
p->overstep = 0; |
return; |
return; |
|
|