From 6ecd9c5caba944d910343802c058940234492e5a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 15 Aug 2022 18:12:30 +0000 Subject: Distinguish between escape sequences that produce no output whatsoever (for example \fR) and escape sequences that produce invisible zero-width output (for example \&). No, i'm not joking, groff does make that distinction, and it has consequences in some situations, for example for vertical spacing in no-fill mode. Heirloom and Plan 9 behaviour is subtly different, but in case of doubt, we want to follow groff. While this fixes the behaviour for the majority of escape sequences, in particular for those most likely to occur in practice, it is not perfect yet because some of the more exotic ESCAPE_IGNORE sequences are actually of the "no output whatsoever" type but treated as "invisible zero-width" for now. With the new ASCII_NBRZW mechanism in place, switching them over one by one when the need arises will no longer be very difficult. --- term_ascii.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'term_ascii.c') diff --git a/term_ascii.c b/term_ascii.c index b062bd99..efab1fa6 100644 --- a/term_ascii.c +++ b/term_ascii.c @@ -196,7 +196,7 @@ terminal_sepline(void *arg) static size_t ascii_width(const struct termp *p, int c) { - return c != ASCII_BREAK; + return c != ASCII_BREAK && c != ASCII_NBRZW; } void -- cgit