summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVsevolod <kefirchik3@gmail.com>2021-10-24 17:01:18 +0300
committerGitHub <noreply@github.com>2021-10-24 16:01:18 +0200
commit782d802d44077e07f80189560f91c86370f11e39 (patch)
tree1f6d563de26a910ca4dc97327bfbe9a8bc5f489c
parentf31ef362931907bbdd3b46cb880b34493c2d1882 (diff)
fix: missing check for negative index in cycle scrolling (#1372)
-rw-r--r--lua/telescope/pickers/scroller.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/lua/telescope/pickers/scroller.lua b/lua/telescope/pickers/scroller.lua
index 8b9bbd5..a658f68 100644
--- a/lua/telescope/pickers/scroller.lua
+++ b/lua/telescope/pickers/scroller.lua
@@ -18,7 +18,7 @@ local scroll_calculators = {
if row >= finish then
return start
elseif row < start then
- return finish - 1
+ return (finish - 1 < 0) and finish or finish - 1
end
return row