1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

use generics to DRY up context code

This commit is contained in:
Jesse Duffield
2022-03-19 09:31:52 +11:00
parent 4b56d428ff
commit d93fef4c61
31 changed files with 117 additions and 364 deletions

View File

@@ -13,7 +13,7 @@ func (gui *Gui) refreshPatchBuildingPanel(selectedLineIdx int) error {
gui.Views.Secondary.Title = "Custom Patch"
// get diff from commit file that's currently selected
node := gui.State.Contexts.CommitFiles.GetSelectedFileNode()
node := gui.State.Contexts.CommitFiles.GetSelected()
if node == nil {
return nil
}
@@ -74,7 +74,7 @@ func (gui *Gui) handleToggleSelectionForPatch() error {
}
// add range of lines to those set for the file
node := gui.State.Contexts.CommitFiles.GetSelectedFileNode()
node := gui.State.Contexts.CommitFiles.GetSelected()
if node == nil {
return nil
}