diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 07:56:14 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 2e05ac0c90848c71ab23728859a7bd4b67c39114 (patch) | |
tree | 936571f345de7b87ebbcc2025d29c04fc1e9d129 /pkg/gui/view_helpers.go | |
parent | 40c5cd4b4b3436da2616e848d40e7760ec99167f (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/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 67abfbc02..06de4179b 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -433,3 +433,15 @@ func (gui *Gui) handlePrevTab(g *gocui.Gui, v *gocui.View) error { utils.ModuloWithWrap(v.TabIndex-1, len(v.Tabs)), ) } + +// this is the distance we will move the cursor when paging up or down in a view +func (gui *Gui) pageDelta(view *gocui.View) int { + _, height := view.Size() + + delta := height - 1 + if delta == 0 { + return 1 + } + + return delta +} |