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 StyleRenderer() gansi.RenderContext
- func StyleRendererWithStyles(styles gansi.StyleConfig) gansi.RenderContext
- func TruncateString(s string, max int) string
- type Common
- func (c *Common) Backend() *backend.Backend
- func (c *Common) CloneCmd(publicURL, name string) string
- 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 ( // DefaultColorProfile is the default color profile used by the SSH server. DefaultColorProfile = termenv.ANSI256 )
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 StyleRenderer ¶ added in v0.7.4
func StyleRenderer() gansi.RenderContext
StyleRenderer returns a new Glamour renderer with the DefaultColorProfile.
func StyleRendererWithStyles ¶ added in v0.7.4
func StyleRendererWithStyles(styles gansi.StyleConfig) gansi.RenderContext
StyleRendererWithStyles returns a new Glamour renderer with the DefaultColorProfile and styles.
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
HideCloneCmd bool
// 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 // Path returns the hierarchical path of the tab. Path() 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.