feat: convert tabs to spaces with Style.TabWidth(int)
#204
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.
Lip Gloss currently mis-measures a tab (i.e. a
\t
) at 0 cells wide when they actually render at different widths in different terminals (usually 8 cells, sometimes 4 cells). For theses reasons tabs are almost never what you want when designing layouts for TUIs.With this revision, a tab will get converted to 4 spaces by default—so this is a behavioral change—but you can customize the behavior and disable it entirely with the new
TabWidth(int)
method.Disable the feature with
Style.TabWidth(-1)
feels a little kludgy but is perhaps okay with the addition of theNoTabConversion
const. The alternative would be to have a separate method for disabling the behavior (Style.DisableTabConversion(true)
or something) but what I don't love about that is that the two settings would then compete with each other.