summaryrefslogtreecommitdiffstats
path: root/pkg/gui/view_helpers.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-10-08 08:01:04 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-10-10 00:23:01 +1100
commit4c9ec88be57ed75c198d19020374bae0365b6e00 (patch)
tree8b69a8fd7ab64009aa028c61bd9a8a109a721efd /pkg/gui/view_helpers.go
parent9011271a014025c514adf72b1d1ee69fbc7f3373 (diff)
fix mutex deadlock
Diffstat (limited to 'pkg/gui/view_helpers.go')
-rw-r--r--pkg/gui/view_helpers.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go
index 64faa5940..bc4c5bada 100644
--- a/pkg/gui/view_helpers.go
+++ b/pkg/gui/view_helpers.go
@@ -405,7 +405,8 @@ func (gui *Gui) wrappedHandler(f func() error) func(g *gocui.Gui, v *gocui.View)
// 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
+ state := gui.State.Panels.LineByLine
+ return state != nil && state.SecondaryFocused
}
func (gui *Gui) clearEditorView(v *gocui.View) {