Documentation
¶
Index ¶
- Variables
- type KeyMap
- type SuggestionTextInput
- func (s *SuggestionTextInput) Blur()
- func (s *SuggestionTextInput) Focus()
- func (s *SuggestionTextInput) SetSuggestions(suggestions []string)
- func (s *SuggestionTextInput) SetValue(val string)
- func (s *SuggestionTextInput) SetWidth(width int)
- func (s *SuggestionTextInput) Update(msg tea.Msg) (*SuggestionTextInput, tea.Cmd)
- func (s *SuggestionTextInput) Value() string
- func (s *SuggestionTextInput) View() string
Constants ¶
This section is empty.
Variables ¶
View Source
var CommandSuggestions = [...]string{
"/inspect <username>",
"/popupchat",
"/channel",
"/pyramid <word> <count>",
"/localsubscribers",
"/localsubscribersoff",
"/uniqueonly",
"/uniqueonlysoff",
"/createclip",
"/emotes",
}
View Source
var DefaultKeyMap = KeyMap{ AcceptSuggestion: key.NewBinding(key.WithKeys("tab")), NextSuggestion: key.NewBinding(key.WithKeys("down", "ctrl+n")), PrevSuggestion: key.NewBinding(key.WithKeys("up", "ctrl+p")), }
DefaultKeyMap is the default set of key bindings for navigating and acting upon the textinput.
View Source
var ModeratorSuggestions = [...]string{
"/ban <user> [reason]",
`/ban_selected {{ if .SelectedDisplayName }}{{ .SelectedDisplayName }}{{ else }}<user>{{ end }} [reason]`,
"/unban <user>",
`/unban_selected {{ if .SelectedDisplayName }}{{ .SelectedDisplayName }}{{ else }}<user>{{ end }}`,
"/timeout <username> [duration] [reason]",
`/timeout_selected {{ if .SelectedDisplayName }}{{ .SelectedDisplayName }}{{ else }}<user>{{ end }} [duration] [reason]`,
"/delete_all_messages",
`/delete_selected_message {{ if .MessageID }}{{ .MessageID }}{{ else }}<message_id>{{ end }}`,
"/banrequests",
"/announcement <blue|green|orange|purple|primary> <message>",
"/announcement blue <message>",
"/announcement green <message>",
"/announcement orange <message>",
"/announcement purple <message>",
"/announcement primary <message>",
"/marker [description]",
}
Functions ¶
This section is empty.
Types ¶
type KeyMap ¶
type KeyMap struct { AcceptSuggestion key.Binding NextSuggestion key.Binding PrevSuggestion key.Binding }
KeyMap is the key bindings for different actions within the textinput.
type SuggestionTextInput ¶
type SuggestionTextInput struct { InputModel textinput.Model KeyMap KeyMap IncludeCommandSuggestions bool IncludeModeratorCommands bool DisableAutoSpaceSuggestion bool DisableHistory bool // contains filtered or unexported fields }
func NewSuggestionTextInput ¶
func NewSuggestionTextInput(userCache map[string]func(...string) string, customSuggestions map[string]string) *SuggestionTextInput
NewSuggestionTextInput creates a new model with default settings.
func (*SuggestionTextInput) Blur ¶
func (s *SuggestionTextInput) Blur()
func (*SuggestionTextInput) Focus ¶
func (s *SuggestionTextInput) Focus()
func (*SuggestionTextInput) SetSuggestions ¶
func (s *SuggestionTextInput) SetSuggestions(suggestions []string)
func (*SuggestionTextInput) SetValue ¶
func (s *SuggestionTextInput) SetValue(val string)
func (*SuggestionTextInput) SetWidth ¶
func (s *SuggestionTextInput) SetWidth(width int)
func (*SuggestionTextInput) Update ¶
func (s *SuggestionTextInput) Update(msg tea.Msg) (*SuggestionTextInput, tea.Cmd)
func (*SuggestionTextInput) Value ¶
func (s *SuggestionTextInput) Value() string
func (*SuggestionTextInput) View ¶
func (s *SuggestionTextInput) View() string
Click to show internal directories.
Click to hide internal directories.