1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-01 22:52:01 +02:00
This commit is contained in:
Jesse Duffield
2020-08-18 22:02:35 +10:00
parent 3c87ff4eff
commit f5b22d94d9
14 changed files with 259 additions and 152 deletions

View File

@@ -21,29 +21,29 @@ func (gui *Gui) handleCommitFileSelect() error {
return nil
}
gui.getMainView().Title = "Patch"
if gui.currentViewName() == "commitFiles" {
gui.handleEscapeLineByLinePanel()
}
commitFile := gui.getSelectedCommitFile()
if commitFile == nil {
// TODO: consider making it so that we can also render strings to our own view through some common interface, or just render this to the main view for consistency
gui.renderString("commitFiles", gui.Tr.SLocalize("NoCommiteFiles"))
return nil
}
if err := gui.refreshSecondaryPatchPanel(); err != nil {
return err
}
cmd := gui.OSCommand.ExecutableFromString(
gui.GitCommand.ShowCommitFileCmdStr(commitFile.Sha, commitFile.Name, false),
)
if err := gui.newPtyTask("main", cmd); err != nil {
gui.Log.Error(err)
}
task := gui.createRunPtyTask(cmd)
return nil
return gui.refreshMain(refreshMainOpts{
main: &viewUpdateOpts{
title: "Patch",
task: task,
},
secondary: gui.secondaryPatchPanelUpdateOpts(),
})
}
func (gui *Gui) handleSwitchToCommitsPanel(g *gocui.Gui, v *gocui.View) error {