summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers
diff options
context:
space:
mode:
authorSimon Hauser <Simon-Hauser@outlook.de>2021-02-24 02:41:00 +0100
committerGitHub <noreply@github.com>2021-02-24 02:41:00 +0100
commit10627e889e82a82560b6fc48ea0ca20e1963d07f (patch)
treeb6c6a782184f3c60ce5ad7e4636cba93c005fae2 /lua/telescope/pickers
parent4dd35ef0e154ab1836fc923a33196a4101a97a9c (diff)
feat: advanced normal mode (#463)
Add <count>j and k to normal mode and H and L to jump at top and bottom of displayed results
Diffstat (limited to 'lua/telescope/pickers')
-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