Documentation
¶
Overview ¶
Package width provides visual width calculations for text, accounting for tabs and multi-byte characters.
Index ¶
Constants ¶
const DefaultTabStop = 8
DefaultTabStop is the default tab width (8 spaces).
Variables ¶
This section is empty.
Functions ¶
func AdvanceColsWithTab ¶
AdvanceColsWithTab returns the column after writing s starting from startCol, with a custom tab stop.
func FirstLineLenWithTab ¶
FirstLineLenWithTab returns the visual width of the first line with custom tab stop.
func LastLineLenWithTab ¶
LastLineLenWithTab returns the visual width of the last line with custom tab stop.
func RuneWidth ¶
RuneWidth returns the display width of a rune. Most runes are width 1, but wide CJK characters and some emoji are width 2. Zero-width characters (combining marks, control chars, etc.) return 0.
func VisualLenWithTab ¶
VisualLenWithTab returns the visual column width of s with a custom tab stop.
Types ¶
This section is empty.