summaryrefslogtreecommitdiffstats
path: root/pkg/gui/list_context.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-02 07:56:14 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commit2e05ac0c90848c71ab23728859a7bd4b67c39114 (patch)
tree936571f345de7b87ebbcc2025d29c04fc1e9d129 /pkg/gui/list_context.go
parent40c5cd4b4b3436da2616e848d40e7760ec99167f (diff)
paging keybindings for line by line panel
support searching in line by line panel move mutexes into their own struct add line by line panel mutex apply LBL panel mutex bump gocui to prevent crashing when search item count decreases
Diffstat (limited to 'pkg/gui/list_context.go')
-rw-r--r--pkg/gui/list_context.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/pkg/gui/list_context.go b/pkg/gui/list_context.go
index 83a4072f1..529a7bd02 100644
--- a/pkg/gui/list_context.go
+++ b/pkg/gui/list_context.go
@@ -186,11 +186,8 @@ func (lc *ListContext) handleNextPage(g *gocui.Gui, v *gocui.View) error {
if err != nil {
return nil
}
- _, height := view.Size()
- delta := height - 1
- if delta == 0 {
- delta = 1
- }
+ delta := lc.Gui.pageDelta(view)
+
return lc.handleLineChange(delta)
}
@@ -207,11 +204,9 @@ func (lc *ListContext) handlePrevPage(g *gocui.Gui, v *gocui.View) error {
if err != nil {
return nil
}
- _, height := view.Size()
- delta := height - 1
- if delta == 0 {
- delta = 1
- }
+
+ delta := lc.Gui.pageDelta(view)
+
return lc.handleLineChange(-delta)
}