Don't wrap around if there are no suggestions in `CommandView`

This commit is contained in:
Guldoman 2022-07-11 23:27:26 +02:00
parent 86024586fd
commit 693bd11b22
No known key found for this signature in database
GPG Key ID: EA928C8BDA1A8825
1 changed files with 1 additions and 0 deletions

View File

@ -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