Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StylesEqual ¶
StylesEqual compares two lipgloss.Style objects for equality. This is a simple comparison that checks if the rendered output would be the same.
Types ¶
type StyleEditor ¶
type StyleEditor struct{}
StyleEditor handles applying style transformations to ANSI-styled text. It preserves existing ANSI styling while adding new styling to specific character ranges. It can be used for search highlighting, error marking, syntax emphasis, or any other inline style modifications.
func (*StyleEditor) ApplyStyles ¶
func (ise *StyleEditor) ApplyStyles(text string, ranges []StyleRange) string
ApplyStyles applies style ranges to ANSI-styled text while preserving existing styling. The ranges are applied in priority order, with higher priority ranges overriding lower ones.
type StyleRange ¶
type StyleRange struct {
Style lipgloss.Style // The style to apply to this range.
Start int // 0-based character position within the line (inclusive).
End int // 0-based character position within the line (exclusive).
Priority int // Priority for overlapping ranges (higher priority wins).
}
StyleRange represents a range of text that should have a specific style applied.