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:
1 parent
11caeddb35
commit
70171adf40
1 file changed
+1
-1
@@ -1362,7 +1362,7 @@ func listMatches(screen tcell.Screen, matches []string, selectedInd int) *bytes.
|
|||||||
wcol = max(wcol, len(m))
|
wcol = max(wcol, len(m))
|
||||||
}
|
}
|
||||||
wcol += gOpts.tabstop - wcol%gOpts.tabstop
|
wcol += gOpts.tabstop - wcol%gOpts.tabstop
|
||||||
ncol := wtot / wcol
|
ncol := max(wtot/wcol, 1)
|
||||||
|
|
||||||
b.WriteString("possible matches\n")
|
b.WriteString("possible matches\n")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user