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
This commit is contained in:
Simon Hauser
2021-02-24 02:41:00 +01:00
committed by GitHub
parent 4dd35ef0e1
commit 10627e889e
5 changed files with 60 additions and 3 deletions

View File

@@ -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