autocomplete: wrap the autocomplete results around (#1223)

This commit is contained in:
Techie Guy 2022-12-06 15:51:14 +05:30 committed by GitHub
parent dfa2f93d9c
commit 68595e4c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -648,11 +648,11 @@ command.add(predicate, {
end,
["autocomplete:previous"] = function()
suggestions_idx = math.max(suggestions_idx - 1, 1)
suggestions_idx = (suggestions_idx - 2) % #suggestions + 1
end,
["autocomplete:next"] = function()
suggestions_idx = math.min(suggestions_idx + 1, #suggestions)
suggestions_idx = (suggestions_idx % #suggestions) + 1
end,
["autocomplete:cycle"] = function()