When a style has a border set and an empty string is rendered, it should
still render the border. When the left border is set, width is
incremented by 1, so in most cases the width will not be 0.
When we render an empty string, with a double border and no left border
we expect the following:
╗
║
╝
But if we don't render a horizontal edge when the string width is less
than 1 we see this:
║
The string width can't be lower than 0, so we can safely remove the
(width < 1) check to create the expected behavior.
Co-authored-by: Daan Schoone <daaschoone@gmail.com>
The function `maxRuneWidth` was using a flawed approach by only
evaluating strings based on each rune. The `uniseg` package provides a
more accurate method based on grapheme clusters.
This change switches over to the improved implementation which should
achieve better results when determining the maximum width of all
grapheme clusters in a string.
Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
* Use lipgloss instances instead of a singleton global instance
* Deprecate (s Style).Render & (s Style).String
* Deprecate the Stringer interface
* Update README and godocs
* Update example
HiddenBorder() can be useful if you want to remove a border but maintain
layout positioning. This said, you can still apply a background color to
a hidden border.