From 693bd11b22622c9152342e5b5a9d1929e7be0099 Mon Sep 17 00:00:00 2001 From: Guldoman Date: Mon, 11 Jul 2022 23:27:26 +0200 Subject: [PATCH] Don't wrap around if there are no suggestions in `CommandView` --- data/core/commandview.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/data/core/commandview.lua b/data/core/commandview.lua index 969338d9..98879e97 100644 --- a/data/core/commandview.lua +++ b/data/core/commandview.lua @@ -111,6 +111,7 @@ end function CommandView:move_suggestion_idx(dir) local function overflow_suggestion_idx(n, count) + if count == 0 then return 0 end if self.state.wrap then return (n - 1) % count + 1 else