diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-03-31 22:08:55 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-02 11:00:15 +1100 |
commit | 332a3c4cbfd263c34d5f53dd971701d2ca69ab4e (patch) | |
tree | 9c2801ce55b7e2bab75fbbaa5dcf82e7d02266ce /pkg/gui/patch_building_panel.go | |
parent | ac41c418092b4561042b52d59b362107a0c2ecd6 (diff) |
file tree for commit files
Diffstat (limited to 'pkg/gui/patch_building_panel.go')
-rw-r--r-- | pkg/gui/patch_building_panel.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index 28926ddb4..8d2d70bf7 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -28,19 +28,19 @@ func (gui *Gui) refreshPatchBuildingPanel(selectedLineIdx int, state *lBlPanelSt gui.getSecondaryView().Title = "Custom Patch" // get diff from commit file that's currently selected - commitFile := gui.getSelectedCommitFile() - if commitFile == nil { + node := gui.getSelectedCommitFileNode() + if node == nil { return nil } - to := commitFile.Parent + to := gui.State.CommitFileChangeManager.GetParent() from, reverse := gui.getFromAndReverseArgsForDiff(to) - diff, err := gui.GitCommand.ShowFileDiff(from, to, reverse, commitFile.Name, true) + diff, err := gui.GitCommand.ShowFileDiff(from, to, reverse, node.GetPath(), true) if err != nil { return err } - secondaryDiff := gui.GitCommand.PatchManager.RenderPatchForFile(commitFile.Name, true, false, true) + secondaryDiff := gui.GitCommand.PatchManager.RenderPatchForFile(node.GetPath(), true, false, true) if err != nil { return err } @@ -78,12 +78,12 @@ func (gui *Gui) handleToggleSelectionForPatch() error { } // add range of lines to those set for the file - commitFile := gui.getSelectedCommitFile() - if commitFile == nil { + node := gui.getSelectedCommitFileNode() + if node == nil { return nil } - if err := toggleFunc(commitFile.Name, state.FirstLineIdx, state.LastLineIdx); err != nil { + if err := toggleFunc(node.GetPath(), state.FirstLineIdx, state.LastLineIdx); err != nil { // might actually want to return an error here gui.Log.Error(err) } |