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

docs: viewport horizontal scroll, gutter, highlight examples #1304

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

caarlos0
Copy link
Member

@caarlos0 caarlos0 commented Feb 3, 2025

example usage of charmbracelet/bubbles#697

@caarlos0 caarlos0 self-assigned this Feb 3, 2025
Comment on lines +58 to +59
vp.KeyMap.Left.SetEnabled(false)
vp.KeyMap.Right.SetEnabled(false)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this should be disabled by default?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm good question. I'd look at existing tools like less and more

@caarlos0 caarlos0 changed the title Scrolls docs: viewport horizontal scroll, gutter, highlight examples Feb 3, 2025
@meowgorithm
Copy link
Member

I'm playing with this a bit and it looks like not all matches are being highlighted and the highlighting jumps a bit (highlights here are in green, with the selected one a darker green. Unless I'm missing something?

pager.mov

@caarlos0
Copy link
Member Author

caarlos0 commented Feb 5, 2025

@meowgorithm looks like you only set the selected highlight style, there's a highlight style as well

@meowgorithm
Copy link
Member

meowgorithm commented Feb 5, 2025

I have these two set, but I'm seeing the same behavior in the example here as well.

m.viewport.HighlightStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("238")).Background(lipgloss.Color("34"))
m.viewport.SelectedHighlightStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("238")).Background(lipgloss.Color("47"))

@meowgorithm
Copy link
Member

Btw, this is a solid API. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants