diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-05-18 22:00:07 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-13 21:50:23 +1000 |
commit | e73937c2bd5c10ba7389392784a1e90af57cc490 (patch) | |
tree | 3dea933a35070034dcbe4af26b59d9634f3f5139 /pkg/gui/view_helpers.go | |
parent | b51ad4fcea2a457b54c0f189e672eac4cc967614 (diff) |
more work on new layout functionality
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r-- | pkg/gui/view_helpers.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 5f742e9cd..56386c872 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -567,3 +567,8 @@ func (gui *Gui) wrappedHandler(f func() error) func(g *gocui.Gui, v *gocui.View) return f() } } + +// secondaryViewFocused tells us whether it appears that the secondary view is focused. The view is actually never focused for real: we just swap the main and secondary views and then you're still focused on the main view so that we can give you access to all its keybindings for free. I will probably regret this design decision soon enough. +func (gui *Gui) secondaryViewFocused() bool { + return gui.State.Panels.LineByLine != nil && gui.State.Panels.LineByLine.SecondaryFocused +} |