1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00
type safe view access
This commit is contained in:
Jesse Duffield
2021-04-04 23:51:59 +10:00
parent 4197921465
commit 4fe512ff3a
36 changed files with 531 additions and 555 deletions

View File

@ -45,7 +45,7 @@ func (gui *Gui) handleCommitFileSelect() error {
cmd := gui.OSCommand.ExecutableFromString(
gui.GitCommand.ShowFileDiffCmdStr(from, to, reverse, node.GetPath(), false),
)
task := gui.createRunPtyTask(cmd)
task := NewRunPtyTask(cmd)
return gui.refreshMainViews(refreshMainOpts{
main: &viewUpdateOpts{
@ -287,7 +287,8 @@ func (gui *Gui) handleToggleCommitFileTreeView() error {
}
}
if gui.getCommitFilesView().Context == COMMIT_FILES_CONTEXT_KEY {
// TODO: pretty sure this view only ever has this context. Is this if condition necessary?
if gui.Views.CommitFiles.Context == COMMIT_FILES_CONTEXT_KEY {
if err := gui.State.Contexts.CommitFiles.HandleRender(); err != nil {
return err
}