From 70171adf400dfba6c2736ec41ffa525aea7f57d9 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Sat, 1 Apr 2023 11:24:55 -0500 Subject: [PATCH] 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 --- ui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui.go b/ui.go index ab07842d..86578499 100644 --- a/ui.go +++ b/ui.go @@ -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")