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

UnderlineSpaces and StrikethroughSpaces don't seem to work properly #113

Closed
knz opened this issue Sep 3, 2022 · 3 comments · Fixed by #299
Closed

UnderlineSpaces and StrikethroughSpaces don't seem to work properly #113

knz opened this issue Sep 3, 2022 · 3 comments · Fixed by #299
Labels
bug Something isn't working

Comments

@knz
Copy link

knz commented Sep 3, 2022

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
Copy link
Author

knz commented Sep 3, 2022

cc @muesli @meowgorithm

@muesli muesli added the bug Something isn't working label Oct 5, 2022
@flippedcracker
Copy link

Seeing the same

@Delta456
Copy link

Delta456 commented May 20, 2024

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 #299. I overlooked the boolean logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants