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

Render whitespace #1218

Closed
wants to merge 1 commit into from
Closed

Conversation

Omnikar
Copy link
Contributor

@Omnikar Omnikar commented Dec 1, 2021

Closes #1068 (intended config behaviour described there).

Currently only "none" and "all" are supported; I still need to figure out what to do to be able to render only whitespace in selections.

To-do:

  • Implement "selection" to render whitespace that falls into a selection.
  • Add colors for rendered whitespace to themes.
  • Allow the characters used to represent whitespace to be configured.

Rendering whitespace by selection not yet implemented.
@valpackett
Copy link
Contributor

The characters should be configurable too, and tabs should be included. e.g. in kakoune I have

add-highlighter global/unicode-whitespace show-whitespaces -tab '▏' -nbsp '␣' -spc ' '

@Omnikar
Copy link
Contributor Author

Omnikar commented Dec 4, 2021

@unrelentingtech OK, I added that as a todo

@archseer
Copy link
Member

archseer commented Dec 5, 2021

Yeah I was thinking this could be a general substitution map:

{ " " = "."} etc. Looks like I forgot to comment on the original issue. But on a second thought that would result in a map lookup per character which isn't great.

Might be able to optimize by using a Vec<Option<char>> where the index would be the ASCII code. That would limit substitutions to ascii chars but I think that's enough.

@archseer
Copy link
Member

archseer commented Dec 5, 2021

Alternatively we could have a hard-coded set of characters we support mapping.

@archseer
Copy link
Member

archseer commented Dec 5, 2021

See also how vim does this http://vimdoc.sourceforge.net/htmldoc/options.html#'listchars'

@the-mikedavis the-mikedavis mentioned this pull request Mar 12, 2022
5 tasks
@archseer
Copy link
Member

Replaced by #1802

@archseer archseer closed this Mar 31, 2022
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.

Configurable rendering of invisible characters like space, tab, and line feed
3 participants