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

@@ -111,4 +111,22 @@ describe('scroller', function()
eq(0, scroller(23, 112, 23))
end)
end)
describe('should give top and bottom index', function()
it('should handle ascending', function()
eq(0, p_scroller.top('ascending', 20, 1000))
eq(19, p_scroller.bottom('ascending', 20, 1000))
eq(0, p_scroller.top('ascending', 20, 10))
eq(9, p_scroller.bottom('ascending', 20, 10))
end)
it('should handle descending', function()
eq(0, p_scroller.top('descending', 20, 1000))
eq(19, p_scroller.bottom('descending', 20, 1000))
eq(10, p_scroller.top('descending', 20, 10))
eq(19, p_scroller.bottom('descending', 20, 10))
end)
end)
end)