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

Allow tab virtual whitespace padding #3458

Merged
merged 1 commit into from
Aug 21, 2022

Conversation

A-Walrus
Copy link
Contributor

@A-Walrus A-Walrus commented Aug 16, 2022

Resolves #3427.
Added new whitespace.characters.tabpad option which sets the padding for tabs
Example:
image

@the-mikedavis
Copy link
Member

I think this is a good angle implementation-wise but it may be preferrable to instead have the config break down like

[editor.whitespace]
render = "all"
characters.tab = { character = "", padding = " " } # default values
# also accept the old syntax for backwards compatibility and simplicity:
characters.tab = ""

# or alternatively
[editor.whitespace.characters]
tab = ""
tabpad = "·" # using kakoune's name but we should probably use something more clear

I think this would be preferrable (albeit a larger change) because the characters could be represented by chars instead of a String - so no allocations - and there isn't a chance of misconfiguring the padding in a confusing way. With the current approach, you could use not enough padding in your configuration and end up being confused why a file with 8-column-width tabs only shows interpuncts for a few of the columns.

Virtual whitespace tabs are created from the `tab` character padded
with `tabpad` up to  the tab width.
@A-Walrus A-Walrus changed the title Allow tab virtual whitespace to be long string Allow tab virtual whitespace padding Aug 16, 2022
@archseer archseer merged commit ed74e6d into helix-editor:master Aug 21, 2022
AlexanderBrevig pushed a commit to AlexanderBrevig/helix that referenced this pull request Aug 29, 2022
Virtual whitespace tabs are created from the `tab` character padded
with `tabpad` up to  the tab width.
thomasskk pushed a commit to thomasskk/helix that referenced this pull request Sep 9, 2022
Virtual whitespace tabs are created from the `tab` character padded
with `tabpad` up to  the tab width.
jdrst pushed a commit to jdrst/helix that referenced this pull request Sep 13, 2022
Virtual whitespace tabs are created from the `tab` character padded
with `tabpad` up to  the tab width.
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.

Tab padding character?
3 participants