mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-09 21:22:26 +03:00
fix: ui: accounts: don't let j or C-n move past bottom
This commit is contained in:
parent
9f6595f122
commit
7bbff6a359
@ -332,9 +332,8 @@ asHandle ui0@UIState{
|
||||
asEnterRegister d clickedacct ui
|
||||
where clickedacct = maybe "" asItemAccountName $ listElements _asList !? y
|
||||
|
||||
-- prevent moving down over blank padding items;
|
||||
-- instead scroll down by one, until maximally scrolled - shows the end has been reached
|
||||
VtyEvent (EvKey (KDown) []) | isBlankElement mnextelement -> do
|
||||
-- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled
|
||||
VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do
|
||||
vScrollBy (viewportScroll $ _asList^.listNameL) 1 >> continue ui
|
||||
where mnextelement = listSelectedElement $ listMoveDown _asList
|
||||
|
||||
|
@ -372,7 +372,7 @@ rsHandle ui@UIState{
|
||||
continue $ screenEnter d transactionScreen{tsAccount=rsAccount} ui
|
||||
where clickeddate = maybe "" rsItemDate $ listElements rsList !? y
|
||||
|
||||
-- when at the last item, instead of moving down, scroll down by one, until maximally scrolled
|
||||
-- when selection is at the last item, DOWN scrolls instead of moving, until maximally scrolled
|
||||
VtyEvent e | e `elem` moveDownEvents, isBlankElement mnextelement -> do
|
||||
vScrollBy (viewportScroll $ rsList ^. listNameL) 1 >> continue ui
|
||||
where mnextelement = listSelectedElement $ listMoveDown rsList
|
||||
|
Loading…
Reference in New Issue
Block a user