Extract ANSI SGR Sequences from string
Note
Tab\t will be replaced by 4 spaces
Extract(string) -> (*ANSITableList, string)
splitstring with ansiintoansi sequencesandraw stringRender(atl *ANSITableList, _s string, startIndex int) -> []byte
Renderstringwithansi sequences,startIndexis the start index of_swhich will be used to fetch ansi tableSearch(bs []BoundStruct, position int) -> (res []int)
binary search index givenBound [2]int, the result is index.
len(res) <= 2and-1means reach the start/end of the slice
len(res) == 1means the position is withinbs[res[0]].Bounds
len(res) == 2means the position is betweenbs[res[0]].Bounds[1]andbs[res[1]].Bounds[0]*ANSITableList SetStyle(style []byte, startIndex, endIndex int)
set style forstring[startIndex:endIndex]