From 782d802d44077e07f80189560f91c86370f11e39 Mon Sep 17 00:00:00 2001 From: Vsevolod Date: Sun, 24 Oct 2021 17:01:18 +0300 Subject: [PATCH] fix: missing check for negative index in cycle scrolling (#1372) --- lua/telescope/pickers/scroller.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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