package strutil

import (
	

	
	
	
)

// FormatTabs replaces all '\t' occurrences in a string with 6 spaces each.
func ( string) string {
	return strings.ReplaceAll(, "\t", "     ")
}

// RealLength returns the real length of a string (the number of terminal
// columns used to render the line, which may contain special graphemes).
// Before computing the width, it replaces tabs with (4) spaces, and strips colors.
func ( string) int {
	 := color.Strip()
	 := strings.ReplaceAll(, "\t", "     ")

	return uniseg.StringWidth()
}

// LineSpan computes the number of columns and lines that are needed for a given line,
// accounting for any ANSI escapes/color codes, and tabulations replaced with 4 spaces.
func ( []rune, ,  int) (,  int) {
	 := term.GetWidth()
	 := RealLength(string())
	 += 

	 :=  / 
	 :=  % 

	// Empty lines are still considered a line.
	if  != 0 {
		++
	}

	return , 
}