types

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 Glamourize

func Glamourize(w int, md string) (string, error)

func Max

func Max(a, b int) int

func NewRenderCtx

func NewRenderCtx(worldwrap int) gansi.RenderContext

func TruncateString

func TruncateString(s string, max int, tail string) string

Types

type BubbleHelper

type BubbleHelper interface {
	Help() []HelpEntry
}

type Commit

type Commit struct {
	*object.Commit
}

type Commits

type Commits []*Commit

func (Commits) Len

func (cl Commits) Len() int

func (Commits) Less

func (cl Commits) Less(i, j int) bool

func (Commits) Swap

func (cl Commits) Swap(i, j int)

type ErrMsg

type ErrMsg struct {
	Err error
}

func (ErrMsg) Error

func (e ErrMsg) Error() string

func (ErrMsg) View

func (e ErrMsg) View(s *style.Styles) string

func (ErrMsg) ViewWithPrefix

func (e ErrMsg) ViewWithPrefix(s *style.Styles, prefix string) string

type HelpEntry

type HelpEntry struct {
	Key   string
	Value string
}

type Repo

type Repo interface {
	Name() string
	GetReference() *plumbing.Reference
	SetReference(*plumbing.Reference) error
	GetReadme() string
	GetCommits(limit int) (Commits, error)
	Repository() *git.Repository
	Tree(path string) (*object.Tree, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL