Documentation ¶
Index ¶
- Variables
- func ErrorCmd(err error) tea.Cmd
- func FormatHighlight(p, c string) (string, error)
- func FormatLineNumber(styles *styles.Styles, s string, color bool) (string, int)
- func RepoURL(publicURL, name string) string
- func StyleConfig() gansi.StyleConfig
- func TruncateString(s string, max int) string
- type Common
- func (c *Common) Backend() *backend.Backend
- func (c *Common) Config() *config.Config
- func (c *Common) Context() context.Context
- func (c *Common) PublicKey() ssh.PublicKey
- func (c *Common) Repo() *git.Repository
- func (c *Common) SetSize(width, height int)
- func (c *Common) SetValue(key, value interface{})
- type Component
- type ErrorMsg
- type TabComponent
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConfigKey = &contextKey{"config"} RepoKey = &contextKey{"repo"} )
Keys to use for context.Context.
View Source
var CloneCmd = func(publicURL, name string) string { return fmt.Sprintf("git clone %s", RepoURL(publicURL, name)) }
CloneCmd returns the URL of the repository.
View Source
var ErrMissingRepo = errors.New("missing repo")
ErrMissingRepo indicates that the requested repository could not be found.
Functions ¶
func FormatHighlight ¶
FormatHighlight adds syntax highlighting to a string.
func FormatLineNumber ¶
FormatLineNumber adds line numbers to a string.
func StyleConfig ¶
func StyleConfig() gansi.StyleConfig
StyleConfig returns the default Glamour style configuration.
func TruncateString ¶
TruncateString is a convenient wrapper around truncate.TruncateString.
Types ¶
type Common ¶
type Common struct {
Width, Height int
Styles *styles.Styles
KeyMap *keymap.KeyMap
Zone *zone.Manager
Output *termenv.Output
Logger *log.Logger
// contains filtered or unexported fields
}
Common is a struct all components should embed.
type TabComponent ¶
type TabComponent interface { Component // StatusBarValue returns the status bar value component. StatusBarValue() string // StatusBarInfo returns the status bar info component. StatusBarInfo() string // SpinnerID returns the ID of the spinner. SpinnerID() int // TabName returns the name of the tab. TabName() string }
TabComponenet represents a model that is mounted to a tab. TODO: find a better name
Click to show internal directories.
Click to hide internal directories.