v0.8.0
Predictable Tabs
At last: tabs that render the way you want ’em to. With the new Style.TabWidth()
method, you can determine exactly how a \t
will render.
Before this release, Lip Gloss used to mis-measure 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 these reasons, tabs are almost never what you want when designing layouts for TUIs.
With this release, a tab will get converted to 4 spaces by default—so this is a behavioral change—but you can customize the behavior as well as disable it entirely.
s := lipgloss.NewStyle() // 4 spaces per tab, the default
s = s.TabWidth(2) // 2 spaces per tab
s = s.TabWidth(0) // remove tabs
s = s.TabWidth(-1) // don't convert tabs to spaces
s = s.TabWidth(NoTabConversion) // alias of the above
You can disable the feature with Style.TabWidth(NoTabConversion)
(or Style.TabWidth(-1)
, if you're the pedantic type).
Bug Fixes
This release also includes a bunch of bug fixes. This includes:
- fix: border size calculation by @mieubrisse in #197
- fix: renderer race condition by @aymanbagabas in #210
- fix: cache color profile and background by @aymanbagabas in #212
Full Changelog: v0.7.1...v0.8.0