summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers/scroller.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/telescope/pickers/scroller.lua')
-rw-r--r--lua/telescope/pickers/scroller.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/lua/telescope/pickers/scroller.lua b/lua/telescope/pickers/scroller.lua
index 3169c4b..8b84e7c 100644
--- a/lua/telescope/pickers/scroller.lua
+++ b/lua/telescope/pickers/scroller.lua
@@ -73,4 +73,18 @@ scroller.create = function(scroll_strategy, sorting_strategy)
end
end
+scroller.top = function(sorting_strategy, max_results, num_results)
+ if sorting_strategy == 'ascending' then
+ return 0
+ end
+ return (num_results > max_results) and 0 or (max_results - num_results)
+end
+
+scroller.bottom = function(sorting_strategy, max_results, num_results)
+ if sorting_strategy == 'ascending' then
+ return math.min(max_results, num_results) - 1
+ end
+ return max_results - 1
+end
+
return scroller