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

feat: make the paginator key bindings customizable #272

Merged
merged 1 commit into from Oct 7, 2022

Conversation

knz
Copy link
Contributor

@knz knz commented Oct 7, 2022

Fixes #271.
This will also make the paginator benefit from the improvement in #261.

cc @maaslalani @meowgorithm

@knz knz mentioned this pull request Oct 7, 2022
34 tasks
Comment on lines 56 to 65
// UsePgUpPgDownKeys is deprecated. Customize KeyMap instead.
UsePgUpPgDownKeys bool
UseLeftRightKeys bool
UseUpDownKeys bool
UseHLKeys bool
UseJKKeys bool
// UseLeftRightKeys is deprecated. Customize KeyMap instead.
UseLeftRightKeys bool
// UseUpDownKeys is deprecated. Customize KeyMap instead.
UseUpDownKeys bool
// UseHLKeys is deprecated. Customize KeyMap instead.
UseHLKeys bool
// UseJKKeys is deprecated. Customize KeyMap instead.
UseJKKeys bool
Copy link
Member

Choose a reason for hiding this comment

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

From https://go.dev/blog/godoc

Sometimes a struct field, function, type, or even a whole package becomes redundant or unnecessary, but must be kept for compatibility with existing programs. To signal that an identifier should not be used, add a paragraph to its doc comment that begins with “Deprecated:” followed by some information about the deprecation.

@maaslalani
Copy link
Member

This looks good to me behaviour wise since I did a quick code search on GitHub repos using the Use**Keys API and mostly found Charm repos and gum forks along with one other repo using it https://github.com/bensadeh/circumflex/blob/0d2b5b24cf9a69eb0eee800dd0f57e3ab31cf503/bubble/list/list.go#L152

image

paginator/paginator.go Outdated Show resolved Hide resolved
paginator/paginator.go Outdated Show resolved Hide resolved
paginator/paginator.go Outdated Show resolved Hide resolved
@maaslalani maaslalani merged commit 85da9ad into charmbracelet:master Oct 7, 2022
@maaslalani
Copy link
Member

Awesome work @knz, thank you!

@knz knz deleted the 20221007-paginator branch October 7, 2022 16:50
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.

paginator: does not support custom key bindings
2 participants