Skip to content

feat: make the paginator key bindings customizable#272

Merged
maaslalani merged 1 commit intocharmbracelet:masterfrom
knz:20221007-paginator
Oct 7, 2022
Merged

feat: make the paginator key bindings customizable#272
maaslalani merged 1 commit intocharmbracelet:masterfrom
knz:20221007-paginator

Conversation

@knz
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@knz knz force-pushed the 20221007-paginator branch from 0d7e4e2 to 1315fd7 Compare October 7, 2022 16:02
@knz knz force-pushed the 20221007-paginator branch from 1315fd7 to dd720c6 Compare October 7, 2022 16:44
@maaslalani maaslalani merged commit 85da9ad into charmbracelet:master Oct 7, 2022
@maaslalani
Copy link
Copy Markdown
Contributor

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