Skip to content

Commit

Permalink
Fix infinite loop in listMatches (#1183)
Browse files Browse the repository at this point in the history
This fixes an issue where listMatches could get stuck in an infinite
loop if one of the matches was longer than the window width.

Fixes #1090
  • Loading branch information
p-ouellette authored Apr 1, 2023
1 parent 11caedd commit 70171ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ func listMatches(screen tcell.Screen, matches []string, selectedInd int) *bytes.
wcol = max(wcol, len(m))
}
wcol += gOpts.tabstop - wcol%gOpts.tabstop
ncol := wtot / wcol
ncol := max(wtot/wcol, 1)

b.WriteString("possible matches\n")

Expand Down

0 comments on commit 70171ad

Please sign in to comment.