mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
@@ -781,7 +781,7 @@ func (t *Terminal) ansiLabelPrinter(str string, color *tui.ColorPair, fill bool)
|
||||
window.CPrint(*color, str)
|
||||
}
|
||||
}
|
||||
return printFn, len(text)
|
||||
return printFn, length
|
||||
}
|
||||
|
||||
// Printer that correctly handles ANSI color codes and tab characters
|
||||
|
||||
@@ -184,3 +184,10 @@ func TestRepeatToFill(t *testing.T) {
|
||||
t.Error("Expected:", strings.Repeat("abcde", 4)+"abcde"[:2])
|
||||
}
|
||||
}
|
||||
|
||||
func TestStringWidth(t *testing.T) {
|
||||
w := StringWidth("─")
|
||||
if w != 1 {
|
||||
t.Errorf("Expected: %d, Actual: %d", 1, w)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user