common

package
v4.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SearchHeight       = 3
	FooterHeight       = 1
	ExpandedHelpHeight = 14
	InputBoxHeight     = 8
	SingleRuneWidth    = 4
	MainContentPadding = 1
	TabsBorderHeight   = 1
	TabsContentHeight  = 2
	TabsHeight         = TabsBorderHeight + TabsContentHeight
	ViewSwitcherMargin = 1
	TableHeaderHeight  = 2
)

Functions

func GetRepoLocalPath

func GetRepoLocalPath(repoName string, cfgPaths map[string]string) (string, bool)

GetRepoLocalPath returns the local path for a given repo name. It will return the path if it exists in the config, or if the repo name matches a wildcard path in the config. It will prioritize exact repo name matches over wildcard matches. If the second return value is true, the first return value is guaranteed to be a valid path. If the second return value is false, the first return value is undefined. For a given config of:

{
  "user/repo": "/path/to/user/repo",
  "user_2/*":  "/path/to/user_2/*",
}

GetRepoLocalPath("user/repo", config) will return: "/path/to/user/repo", true GetRepoLocalPath("user_2/some_repo", config) will return: "/path/to/user_2/some_repo", true GetRepoLocalPath("user/other_repo", config) will return: "", false

func RenderLabels

func RenderLabels(sidebarWidth int, labels []data.Label, pillStyle lipgloss.Style) string

Types

type CommonStyles

type CommonStyles struct {
	MainTextStyle lipgloss.Style
	FooterStyle   lipgloss.Style
	ErrorStyle    lipgloss.Style
	WaitingGlyph  string
	FailureGlyph  string
	SuccessGlyph  string
}

func BuildStyles

func BuildStyles(theme theme.Theme) CommonStyles

Jump to

Keyboard shortcuts

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