mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.99k stars 715 forks source link

Highlight ASCII control characters unambiguously #5231

Open alois31 opened 2 months ago

alois31 commented 2 months ago

Previously, all ASCII control characters would be shown as the replacement character. This leads to a visual loss of information and ambiguities, particularly when opening files that contain lots of control characters (or binary files). Use the common circumflex notation, known from software such as cat -v or vim, instead.

Fixes #2936

mawww commented 2 months ago

I am afraid this will make vertical movements a bit broken as we use the buffer line column width so we are not relying on highlighting at all for this. If we really want to change this I'd prefer to use the unicode control pictures which should not shift anything vertically.

alois31 commented 2 months ago

Thank you for catching the breakage. Not sure if the Unicode pictures are much better than the current state, they are almost completely unreadable with many fonts in normal sizes.

arachsys commented 3 weeks ago

Random thought: would a more readable alternative to a replacement character or a tiny unicode control picture be a specially highlighted letter, e.g. ^a (optionally?) becomes an 'a' in a special face instead of �?