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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user