From 64782a433e6de09ed797266f463b2552ee6ae1c7 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Fri, 31 Jan 2020 08:07:34 +1100 Subject: fix segfault on line by line panel The state object is sometimes undefined in the onclick method of the line by line panel. Because we set it to nil in a bunch of places, I've decided to just change the main context to 'normal' before setting it to nil anywhere. That way the keybindings for the line by line panel won't get executed and we won't get a segfault. --- pkg/gui/commits_panel.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkg/gui/commits_panel.go') diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index abc6b47ec..d25d9b239 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -49,7 +49,7 @@ func (gui *Gui) handleCommitSelect(g *gocui.Gui, v *gocui.View) error { gui.getMainView().Title = "Patch" gui.getSecondaryView().Title = "Custom Patch" - gui.State.Panels.LineByLine = nil + gui.handleEscapeLineByLinePanel() commit := gui.getSelectedCommit(g) if commit == nil { -- cgit v1.2.3