chore: Go 1.26 modernization #7

Merged
Charon merged 4 commits from chore/go-1.26-modernization into main 2026-02-24 18:01:45 +00:00
2 changed files with 3 additions and 12 deletions
Showing only changes of commit 0941ba865f - Show all commits

View file

@ -266,10 +266,7 @@ func (f *Frame) viewLocked() string {
footerH = 1
}
}
middleH := h - headerH - footerH
if middleH < 1 {
middleH = 1
}
middleH := max(h-headerH-footerH, 1)
// Render each region
header := f.renderRegionLocked(RegionHeader, w, headerH)
@ -287,10 +284,7 @@ func (f *Frame) viewLocked() string {
rightW = w / 4
}
}
contentW := w - leftW - rightW
if contentW < 1 {
contentW = 1
}
contentW := max(w-leftW-rightW, 1)
left := f.renderRegionLocked(RegionLeft, leftW, middleH)
right := f.renderRegionLocked(RegionRight, rightW, middleH)

View file

@ -288,10 +288,7 @@ func (t *Table) constrainWidths(widths []int) {
}
// Shrink widest columns first until we fit.
budget := t.maxWidth - overhead
if budget < cols {
budget = cols
}
budget := max(t.maxWidth-overhead, cols)
for total-overhead > budget {
maxIdx, maxW := 0, 0
for i, w := range widths {