Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultRenderCtx() gansi.RenderContext
- func DefaultStyles() gansi.StyleConfig
- func Glamourize(w int, md string) (string, error)
- func Max(a, b int) int
- func NewRenderCtx(worldwrap int) gansi.RenderContext
- func RenderFile(path, content string, width int) (string, error)
- func TruncateString(s string, max int, tail string) string
- type BubbleHelper
- type BubbleReset
- type ErrMsg
- type GitRepo
- type HelpEntry
Constants ¶
View Source
const ( GlamourMaxWidth = 120 RepoNameMaxWidth = 32 MaxDiffLines = 1000 MaxDiffFiles = 100 MaxPatchWait = time.Second * 3 )
Variables ¶
View Source
var ( PrevPage = key.NewBinding( key.WithKeys("pgup", "b", "u"), key.WithHelp("pgup", "prev page"), ) NextPage = key.NewBinding( key.WithKeys("pgdown", "f", "d"), key.WithHelp("pgdn", "next page"), ) )
View Source
var ( ErrDiffTooLong = errors.New("diff is too long") ErrDiffFilesTooLong = errors.New("diff files are too long") ErrBinaryFile = errors.New("binary file") ErrFileTooLarge = errors.New("file is too large") ErrInvalidFile = errors.New("invalid file") )
View Source
var ( RenderCtx = DefaultRenderCtx() Styles = DefaultStyles() )
Functions ¶
func DefaultRenderCtx ¶
func DefaultRenderCtx() gansi.RenderContext
func DefaultStyles ¶
func DefaultStyles() gansi.StyleConfig
func NewRenderCtx ¶
func NewRenderCtx(worldwrap int) gansi.RenderContext
Types ¶
type BubbleHelper ¶
type BubbleHelper interface {
Help() []HelpEntry
}
type BubbleReset ¶
type GitRepo ¶
type GitRepo interface { Name() string Readme() (string, string) HEAD() (*git.Reference, error) CommitsByPage(*git.Reference, int, int) (git.Commits, error) CountCommits(*git.Reference) (int64, error) Diff(*git.Commit) (*git.Diff, error) References() ([]*git.Reference, error) Tree(*git.Reference, string) (*git.Tree, error) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.