bat icon indicating copy to clipboard operation
bat copied to clipboard

Highlight trailing whitespace

Open telotortium opened this issue 3 years ago • 5 comments

It would be nice to be able to see trailing whitespace when viewing a file. Perhaps it could be highlighted in a special color.

telotortium avatar Jul 21 '22 20:07 telotortium

Have you considered using bat -A to show all special characters? Because currently the only way to currently achieve this is when the syntax definition scopes trailing whitespace specially, like for Markdown. Otherwise, we'd need to make some major changes to facilitate this functionality: https://github.com/sharkdp/bat/issues/414#issuecomment-689784292

keith-hall avatar Jul 22 '22 13:07 keith-hall

Another option would be a special "trailing_whitespace" syntax that would only highlight trailing whitespace. This way, users could do bat -ltrailing or bat -ltrailing_whitespace in case they are interested in debugging whitespace issues.

sharkdp avatar Jul 25 '22 19:07 sharkdp