Fix infinite loop in listMatches (#1183)

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
This commit is contained in:
Paul Ouellette authored and GitHub committed 2023-04-01 19:24:55 +03:00
1 parent 11caeddb35
commit 70171adf40
1 file changed
+1 -1
+1 -1
View File
@@ -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")