Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight ASCII control characters unambiguously #5231

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

alois31
Copy link

@alois31 alois31 commented Sep 8, 2024

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

I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
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 mawww#2936
@mawww
Copy link
Owner

mawww commented Sep 9, 2024

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 alois31 marked this pull request as draft September 9, 2024 16:18
@alois31
Copy link
Author

alois31 commented Sep 9, 2024

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
Copy link
Contributor

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 �?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Control Characters as ^A, ^M
3 participants