Documentation
¶
Overview ¶
Package color defines static 16-color ANSI escape sequences and diff action classifications.
Index ¶
Constants ¶
const ( Reset = "\x1b[0m" Bold = "\x1b[1m" Dim = "\x1b[2m" Italic = "\x1b[3m" Underline = "\x1b[4m" )
Terminal text formatting escape sequences.
const ( InsertFg = "\x1b[32m" DeleteFg = "\x1b[31m" MoveFg = "\x1b[36m" Move0Fg = "\x1b[36m" // Slot 0: Cyan / Teal Move1Fg = "\x1b[35m" // Slot 1: Magenta / Mauve Move2Fg = "\x1b[94m" // Slot 2: Bright Blue / Sapphire UpdateFg = "\x1b[33m" HeaderFg = "\x1b[35m" OverlayFg = "\x1b[90m" SurfaceFg = "\x1b[90m" TextFg = "\x1b[39m" )
Standard 16-color ANSI foreground escape sequences.
Variables ¶
This section is empty.
Functions ¶
func MoveFgForSlot ¶ added in v0.10.0
MoveFgForSlot returns the ANSI foreground sequence for a given move color slot.
Types ¶
type ActionKind ¶
type ActionKind int
ActionKind represents the semantic category of an AST diff action or hunk line.
const ( ActionNone ActionKind = iota - 1 ActionDelete ActionInsert ActionUpdate ActionMove ActionMoveUpdate ActionMove1 ActionMoveUpdate1 ActionMove2 ActionMoveUpdate2 )
func MoveActionKindForSlot ¶ added in v0.10.0
func MoveActionKindForSlot(slot int, isUpdate bool) ActionKind
MoveActionKindForSlot maps a slot index (0, 1, 2) and update flag to an ActionKind.
func (ActionKind) String ¶
func (k ActionKind) String() string
String returns the canonical name for an action kind.