diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-29 18:44:08 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-29 18:48:10 +1100 |
commit | 79299be3b23725e4055ca264e6fa0a0c16af430f (patch) | |
tree | 8d7a2ef58e90aa9fe85656714312da65bc40ae18 /pkg/gui/line_by_line_panel.go | |
parent | 4c9b620bd0b24ce04b55e5b30f04dce8fa093be1 (diff) |
better keybindings for patch building mode
Diffstat (limited to 'pkg/gui/line_by_line_panel.go')
-rw-r--r-- | pkg/gui/line_by_line_panel.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/gui/line_by_line_panel.go b/pkg/gui/line_by_line_panel.go index c9e06eeba..4a0f1258d 100644 --- a/pkg/gui/line_by_line_panel.go +++ b/pkg/gui/line_by_line_panel.go @@ -220,6 +220,10 @@ func (gui *Gui) handleMouseScrollDown(g *gocui.Gui, v *gocui.View) error { return gui.handleCycleLine(1) } +func (gui *Gui) getSelectedCommitFileName() string { + return gui.State.CommitFiles[gui.State.Panels.CommitFiles.SelectedLine].Name +} + func (gui *Gui) refreshMainView() error { state := gui.State.Panels.LineByLine @@ -227,7 +231,7 @@ func (gui *Gui) refreshMainView() error { // I'd prefer not to have knowledge of contexts using this file but I'm not sure // how to get around this if gui.State.MainContext == "patch-building" { - filename := gui.State.CommitFiles[gui.State.Panels.CommitFiles.SelectedLine].Name + filename := gui.getSelectedCommitFileName() includedLineIndices = gui.GitCommand.PatchManager.GetFileIncLineIndices(filename) } colorDiff := state.PatchParser.Render(state.FirstLineIdx, state.LastLineIdx, includedLineIndices) |