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 IsFileMarkdown(content, ext string) bool
- 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
- func UnquoteFilename(s string) 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 ¶
var ( ConfigKey = &contextKey{"config"} RepoKey = &contextKey{"repo"} )
Keys to use for context.Context.
var DefaultColorProfile = termenv.ANSI256
DefaultColorProfile is the default color profile used by the SSH server.
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 IsFileMarkdown ¶ added in v0.7.5
IsFileMarkdown returns true if the file is markdown. It uses chroma lexers to analyze and determine the language.
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.
func UnquoteFilename ¶ added in v0.7.5
UnquoteFilename unquotes a filename. When Git is with "core.quotePath" set to "true" (default), it will quote the filename with double quotes if it contains control characters or unicode. this function will unquote the filename.
Types ¶
type Common ¶
type Common struct {
Width, Height int
Styles *styles.Styles
KeyMap *keymap.KeyMap
Zone *zone.Manager
Renderer *lipgloss.Renderer
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