Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultMultiSelectKeyMap = MultiSelectKeyMap{ Prev: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "move up"), ), Next: key.NewBinding( key.WithKeys("down", "j", "tab"), key.WithHelp("↓/j/tab", "move down"), ), Select: key.NewBinding( key.WithKeys(" "), key.WithHelp("space", "select"), ), Confirm: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "confirm"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "toggle help"), ), Quit: key.NewBinding( key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("q", "quit"), ), }
View Source
var DefaultSingleSelectKeyMap = SingleSelectKeyMap{ Prev: key.NewBinding( key.WithKeys("up", "k"), key.WithHelp("↑/k", "move up"), ), Next: key.NewBinding( key.WithKeys("down", "j", "tab"), key.WithHelp("↓/j/tab", "move down"), ), Confirm: key.NewBinding( key.WithKeys("enter"), key.WithHelp("enter", "confirm"), ), Help: key.NewBinding( key.WithKeys("?"), key.WithHelp("?", "toggle help"), ), Quit: key.NewBinding( key.WithKeys("q", "esc", "ctrl+c"), key.WithHelp("q", "quit"), ), }
View Source
var (
ErrQuit = errors.New("user exited prompt")
)
Functions ¶
func ListBranches ¶
Types ¶
type Item ¶ added in v0.4.0
func ItemsFromBranches ¶ added in v0.4.0
func RunMultiSelect ¶ added in v0.4.0
func RunSingleSelect ¶ added in v0.4.0
type MultiSelectKeyMap ¶
type MultiSelectKeyMap struct { Prev key.Binding Next key.Binding Select key.Binding Confirm key.Binding Help key.Binding Quit key.Binding }
func (MultiSelectKeyMap) FullHelp ¶
func (k MultiSelectKeyMap) FullHelp() [][]key.Binding
func (MultiSelectKeyMap) ShortHelp ¶
func (k MultiSelectKeyMap) ShortHelp() []key.Binding
type MultiSelectModel ¶ added in v0.4.0
type MultiSelectModel struct {
// contains filtered or unexported fields
}
func NewMultiSelectModel ¶ added in v0.4.0
func NewMultiSelectModel(items []*Item) *MultiSelectModel
func (*MultiSelectModel) Error ¶ added in v0.4.0
func (m *MultiSelectModel) Error() error
func (*MultiSelectModel) Init ¶ added in v0.4.0
func (m *MultiSelectModel) Init() tea.Cmd
func (*MultiSelectModel) SelectedItems ¶ added in v0.4.0
func (m *MultiSelectModel) SelectedItems() []*Item
func (*MultiSelectModel) View ¶ added in v0.4.0
func (m *MultiSelectModel) View() string
type RenderItemFunc ¶ added in v0.4.0
type SelectModel ¶ added in v0.4.0
type SelectModel struct {
// contains filtered or unexported fields
}
func NewSingleSelectModel ¶ added in v0.4.0
func NewSingleSelectModel(items []*Item) *SelectModel
func (*SelectModel) Error ¶ added in v0.4.0
func (m *SelectModel) Error() error
func (*SelectModel) Init ¶ added in v0.4.0
func (m *SelectModel) Init() tea.Cmd
func (*SelectModel) SelectedItem ¶ added in v0.4.0
func (m *SelectModel) SelectedItem() *Item
func (*SelectModel) View ¶ added in v0.4.0
func (m *SelectModel) View() string
type SingleSelectKeyMap ¶
type SingleSelectKeyMap struct { Prev key.Binding Next key.Binding Confirm key.Binding Help key.Binding Quit key.Binding }
func (SingleSelectKeyMap) FullHelp ¶
func (k SingleSelectKeyMap) FullHelp() [][]key.Binding
func (SingleSelectKeyMap) ShortHelp ¶
func (k SingleSelectKeyMap) ShortHelp() []key.Binding
Click to show internal directories.
Click to hide internal directories.