Private
Public Access
1
0

tui: Chat view footer rewrite

Rewrote footer handling to better handle truncation, and use
`ActiveModel` to return the (stylized) active model
This commit is contained in:
2024-09-26 18:31:04 +00:00
parent 69cdc0a5aa
commit 2fed682969
2 changed files with 74 additions and 26 deletions

View File

@@ -54,6 +54,13 @@ func Height(str string) int {
return strings.Count(str, "\n") + 1
}
func Width(str string) int {
if str == "" {
return 0
}
return ansi.PrintableRuneWidth(str)
}
// truncate a string until its rendered cell width + the provided tail fits
// within the given width
func TruncateToCellWidth(str string, width int, tail string) string {