ansisafe

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPartialReverseVideo added in v0.0.112

func ApplyPartialReverseVideo(line string, startCol, endCol int) string

ApplyPartialReverseVideo applies a selection background highlight to the visual column range [startCol, endCol). endCol == -1 means end-of-line. Columns are measured in visible (cell-width) units; ANSI escape sequences are transparent. Existing foreground colors are preserved.

func ApplyReverseVideo added in v0.0.112

func ApplyReverseVideo(line string) string

ApplyReverseVideo applies a selection background highlight to the full line, re-asserting the background after any embedded SGR resets so that existing foreground colors are preserved.

func SuffixBytes

func SuffixBytes(s []byte, pos int) []byte

SuffixBytes returns s[pos:] but adjusts pos forward if it would split an ANSI CSI sequence.

func SuffixString

func SuffixString(s string, pos int) string

SuffixString returns s[pos:] but adjusts pos forward if it would split an ANSI CSI sequence.

Types

This section is empty.

Jump to

Keyboard shortcuts

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