lipgloss icon indicating copy to clipboard operation
lipgloss copied to clipboard

`UnderlineSpaces` and `StrikethroughSpaces` don't seem to work properly

Open knz opened this issue 3 years ago • 3 comments

We're supposed to be able to use these methods to decide whether spaces are subject to the underline/strikethrough styles.

Unfortunately, this effect is not reached. There's no visible difference in the output.

Screenshot_2022-09-03_23-07-32

Found while working on #109.

knz avatar Sep 03 '22 21:09 knz

cc @muesli @meowgorithm

knz avatar Sep 03 '22 21:09 knz

Seeing the same

flippedcracker avatar May 06 '24 04:05 flippedcracker

~~I investigated this issue and it looks like both UnderlineSpaces and StrikethroughSpaces don't work because Underline will underline the whole string along with the spaces.~~

~~More info in the below screenshot and code:~~

image

buttonStyle = lipgloss.NewStyle().
			Foreground(lipgloss.Color("#FFF7DB")).
			Background(lipgloss.Color("#888B7E")).
			Padding(0, 3).
			MarginTop(1)

	activeButtonStyle = buttonStyle.
				Foreground(lipgloss.Color("#FFF7DB")).
				Background(lipgloss.Color("#F25D94")).
				MarginRight(2).
				Underline(true).UnderlineSpaces(false)

~~To solve this one would have to check the flag when writing to the string buffer and skip the spaces when underlining or using strikethrough.~~

EDIT: Check https://github.com/charmbracelet/lipgloss/pull/299. I overlooked the boolean logic.

Delta456 avatar May 20 '24 11:05 Delta456