Skip to content

feat(table): additional help keys#720

Open
digitalkaoz wants to merge 1 commit intocharmbracelet:masterfrom
digitalkaoz:feat/table-additional-help-keys
Open

feat(table): additional help keys#720
digitalkaoz wants to merge 1 commit intocharmbracelet:masterfrom
digitalkaoz:feat/table-additional-help-keys

Conversation

@digitalkaoz
Copy link

adds additional keys to the table component:

// additional short help keys
	tbl := table.New(
		table.WithAdditionalShortHelpKeys([]key.Binding{
			key.NewBinding(key.WithKeys("s"), key.WithHelp("s", "shortkey")),
		}),
	)

        tbl.HelpView()
// additional full help keys
	tbl := table.New(
		table.WithAdditionalFullHelpKeys([][]key.Binding{
			{
				key.NewBinding(key.WithKeys("f"), key.WithHelp("s", "fullkey")),
			},
		}),
	)
        tbl.Help.ShowAll = true

        tbl.HelpView()

note: the handling of those keys must be done in your userland code!

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.

1 participant