version 1.30, 2010/04/23 00:23:47 |
version 1.31, 2010/05/14 19:52:43 |
|
|
* beginning of a line, one between words -- but do not |
* beginning of a line, one between words -- but do not |
* actually write them yet. |
* actually write them yet. |
*/ |
*/ |
vbl = (size_t)(ASCII_EOS == p->buf[i] ? 2 : |
vbl = (size_t)(0 == vis ? 0 : 1); |
(0 == vis ? 0 : 1)); |
|
vis += vbl; |
vis += vbl; |
vend = vis; |
vend = vis; |
|
|
|
|
break; |
break; |
else if (8 == p->buf[j]) |
else if (8 == p->buf[j]) |
vend--; |
vend--; |
else if (ASCII_EOS != p->buf[j]) { |
else { |
if (vend > vis && vend < bp && |
if (vend > vis && vend < bp && |
'-' == p->buf[j]) |
'-' == p->buf[j]) |
jhy = j; |
jhy = j; |
|
|
} |
} |
|
|
/* |
/* |
* Skip empty words. This happens due to the ASCII_EOS |
|
* after the end of the final sentence of a paragraph. |
|
*/ |
|
if (vend == vis && j == (int)p->col) |
|
break; |
|
|
|
/* |
|
* Usually, indent the first line of each paragraph. |
* Usually, indent the first line of each paragraph. |
*/ |
*/ |
if (0 == i && ! (p->flags & TERMP_NOLPAD)) { |
if (0 == i && ! (p->flags & TERMP_NOLPAD)) { |
|
|
} |
} |
if (ASCII_NBRSP == p->buf[i]) |
if (ASCII_NBRSP == p->buf[i]) |
putchar(' '); |
putchar(' '); |
else if (ASCII_EOS != p->buf[i]) |
else |
putchar(p->buf[i]); |
putchar(p->buf[i]); |
} |
} |
p->viscol += vend - vis; |
p->viscol += vend - vis; |
|
|
break; |
break; |
} |
} |
|
|
if ( ! (TERMP_NOSPACE & p->flags)) |
if ( ! (TERMP_NOSPACE & p->flags)) { |
bufferc(p, ' '); |
bufferc(p, ' '); |
|
if (TERMP_SENTENCE & p->flags) |
|
bufferc(p, ' '); |
|
} |
|
|
if ( ! (p->flags & TERMP_NONOSPACE)) |
if ( ! (p->flags & TERMP_NONOSPACE)) |
p->flags &= ~TERMP_NOSPACE; |
p->flags &= ~TERMP_NOSPACE; |
|
|
|
p->flags &= ~TERMP_SENTENCE; |
|
|
/* FIXME: use strcspn. */ |
/* FIXME: use strcspn. */ |
|
|
while (*word) { |
while (*word) { |
|
|
p->flags |= TERMP_NOSPACE; |
p->flags |= TERMP_NOSPACE; |
} |
} |
|
|
|
/* |
|
* Note that we don't process the pipe: the parser sees it as |
|
* punctuation, but we don't in terms of typography. |
|
*/ |
if (sv[0] && 0 == sv[1]) |
if (sv[0] && 0 == sv[1]) |
switch (sv[0]) { |
switch (sv[0]) { |
case('('): |
case('('): |