"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: fix display of lines ending in \r\n
To:
Christian Weisgerber <naddy@mips.inka.de>
Cc:
gameoftrees@openbsd.org
Date:
Fri, 11 Dec 2020 00:14:13 +0100

Download raw body.

Thread
On Fri, Dec 11, 2020 at 12:04:25AM +0100, Christian Weisgerber wrote:
> Stefan Sperling:
> 
> > @@ -1175,8 +1176,12 @@ format_line(wchar_t **wlinep, int *widthp, const char 
> >  
> >  	i = 0;
> >  	while (i < wlen) {
> > -		int width = wcwidth(wline[i]);
> > +		int width;
> >  
> > +		if (iswcntrl(wline[i]))
> > +			wline[i] = L'?';
> 
> I think that will match TABs.
> ... && wline[i] != L'\t'

See my updated diff which uses iswspace instead.

> Some source files also have old-style ^L pagination.

^L seems to show up fine for me. It displays as "^L", i.e. ^ and L.

> I do like ^ notation for control characters.

Does that mean you'd rather just special-case ESC instead of the above patch?