Final(?) chat view footer fix
This commit is contained in:
parent
c9a7eee090
commit
2ea8a73eb5
@ -341,19 +341,20 @@ func (m *Model) layoutFooter(
|
|||||||
return footerStyle.Render(left + padding + right)
|
return footerStyle.Render(left + padding + right)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert between left and right segments when they're being truncated
|
// Inserted between left and right segments when they're being truncated
|
||||||
truncSeparator := "..."
|
div := "..."
|
||||||
|
|
||||||
totalAvailableWidth := width - frameWidth - len(truncSeparator)
|
totalAvailableWidth := width - frameWidth
|
||||||
|
availableTruncWidth := totalAvailableWidth - len(div)
|
||||||
|
|
||||||
minVisibleLength := 3
|
minVisibleLength := 3
|
||||||
if totalAvailableWidth < 2*minVisibleLength {
|
if availableTruncWidth < 2*minVisibleLength {
|
||||||
minVisibleLength = totalAvailableWidth / 2
|
minVisibleLength = availableTruncWidth / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
leftProportion := float64(leftWidth) / float64(leftWidth+rightWidth)
|
leftProportion := float64(leftWidth) / float64(leftWidth+rightWidth)
|
||||||
|
|
||||||
newLeftWidth := int(max(float64(minVisibleLength), leftProportion*float64(totalAvailableWidth)))
|
newLeftWidth := int(max(float64(minVisibleLength), leftProportion*float64(availableTruncWidth)))
|
||||||
newRightWidth := totalAvailableWidth - newLeftWidth
|
newRightWidth := totalAvailableWidth - newLeftWidth
|
||||||
|
|
||||||
truncatedLeft := faintStyle.Render(tuiutil.TruncateRightToCellWidth(left, newLeftWidth, ""))
|
truncatedLeft := faintStyle.Render(tuiutil.TruncateRightToCellWidth(left, newLeftWidth, ""))
|
||||||
|
Loading…
Reference in New Issue
Block a user