Skip to content

Commit

Permalink
fix: more
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Feb 4, 2025
1 parent 15a6dd3 commit ea68311
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
7 changes: 0 additions & 7 deletions filepicker/filepicker.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,3 @@ func (m Model) canSelect(file string) bool {
}
return false
}

func max(a, b int) int {
if a > b {
return a
}
return b
}
7 changes: 0 additions & 7 deletions list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -1323,10 +1323,3 @@ func countEnabledBindings(groups [][]key.Binding) (agg int) {
}
return agg
}

func max(a, b int) int {
if a > b {
return a
}
return b
}
9 changes: 3 additions & 6 deletions viewport/viewport.go
Original file line number Diff line number Diff line change
Expand Up @@ -688,12 +688,9 @@ func clamp(v, low, high int) int {
}

func maxLineWidth(lines []string) int {
maxlen := 0
result := 0
for _, line := range lines {
llen := ansi.StringWidth(line)
if llen > maxlen {
maxlen = llen
}
result = max(result, ansi.StringWidth(line))
}
return maxlen
return result
}

0 comments on commit ea68311

Please sign in to comment.