Draw Invisible Characters#334
Merged
thecoolwinter merged 7 commits intoCodeEditApp:mainfrom Jun 18, 2025
Merged
Conversation
Adds a configuration option to draw invisible characters.
Collaborator
austincondiff
left a comment
There was a problem hiding this comment.
This comment may necessitate change in this PR to have a warning characters setting separate from the invisible characters.
Collaborator
Author
@austincondiff That's a good point, lets do both. |
Collaborator
Author
|
@austincondiff updated to split the warning characters into their own parameter and documentation. |
austincondiff
approved these changes
Jun 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a configuration option to draw invisible characters.
By default, draws spaces as a small dot, with emphasis on spaces that align with the user's selected indent width. Draws tabs as a small arrow. Draws line endings (carriage returns and line feeds) as a
¬character.Replacement characters are configurable using the config object.
Adds a configuration option to warn users about potentially dangerous/unnecessary characters that may not be visible to the naked eye. This could be used to warn about something like a zero-width space being accidentally copied into a file.
Detailed changes
InvisibleCharactersConfigtype that contains toggles for certain whitespace characters, as well as a set of 'warning' characters to draw warning boxes on.InvisibleCharactersCoordinatorthat tells the text view how to draw characters depending on the current configuration.invisibleCharacterConfigoption toCodeEditSourceEditorandTextViewController.warningCharactersoption toCodeEditSourceEditorandTextViewController.TextViewControllerto correctly update the coordinator when the user's theme, font, or indent option are updated.Related Issues
Checklist
Screenshots
Example document with tabs, spaces, newlines, and a zero-width character pasted in before the
1. It responds to theme updates and live editing.Screen.Recording.2025-06-12.at.1.27.39.PM.mov