summaryrefslogtreecommitdiffstats
path: root/pkg/gui/branches_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-20 08:53:10 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit146722beb875d6f44a9d05b289e1cf92e8518932 (patch)
tree2694b571bcce5d1e2a1fa83815abd8d4682894aa /pkg/gui/branches_panel.go
parenteb5e54e9fd649e556d8c639ff87fedbfe02ff8e9 (diff)
rename to SelectedLineIdx
Diffstat (limited to 'pkg/gui/branches_panel.go')
-rw-r--r--pkg/gui/branches_panel.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go
index 1d617ba8e..17af8005e 100644
--- a/pkg/gui/branches_panel.go
+++ b/pkg/gui/branches_panel.go
@@ -15,7 +15,7 @@ func (gui *Gui) getSelectedBranch() *commands.Branch {
return nil
}
- selectedLine := gui.State.Panels.Branches.SelectedLine
+ selectedLine := gui.State.Panels.Branches.SelectedLineIdx
if selectedLine == -1 {
return nil
}
@@ -76,10 +76,10 @@ func (gui *Gui) refreshBranches() {
// specific functions
func (gui *Gui) handleBranchPress(g *gocui.Gui, v *gocui.View) error {
- if gui.State.Panels.Branches.SelectedLine == -1 {
+ if gui.State.Panels.Branches.SelectedLineIdx == -1 {
return nil
}
- if gui.State.Panels.Branches.SelectedLine == 0 {
+ if gui.State.Panels.Branches.SelectedLineIdx == 0 {
return gui.createErrorPanel(gui.Tr.SLocalize("AlreadyCheckedOutBranch"))
}
branch := gui.getSelectedBranch()
@@ -143,8 +143,8 @@ func (gui *Gui) handleCheckoutRef(ref string, options handleCheckoutRefOptions)
cmdOptions := commands.CheckoutOptions{Force: false, EnvVars: options.EnvVars}
onSuccess := func() {
- gui.State.Panels.Branches.SelectedLine = 0
- gui.State.Panels.Commits.SelectedLine = 0
+ gui.State.Panels.Branches.SelectedLineIdx = 0
+ gui.State.Panels.Commits.SelectedLineIdx = 0
// loading a heap of commits is slow so we limit them whenever doing a reset
gui.State.Panels.Commits.LimitCommits = true
}
@@ -246,7 +246,7 @@ func (gui *Gui) createNewBranchWithName(newBranchName string) error {
if err := gui.GitCommand.NewBranch(newBranchName, branch.Name); err != nil {
return gui.surfaceError(err)
}
- gui.State.Panels.Branches.SelectedLine = 0
+ gui.State.Panels.Branches.SelectedLineIdx = 0
return gui.refreshSidePanels(refreshOptions{mode: ASYNC})
}
@@ -408,7 +408,7 @@ func (gui *Gui) handleFastForward(g *gocui.Gui, v *gocui.View) error {
go func() {
_ = gui.createLoaderPanel(v, message)
- if gui.State.Panels.Branches.SelectedLine == 0 {
+ if gui.State.Panels.Branches.SelectedLineIdx == 0 {
_ = gui.pullWithMode("ff-only", PullFilesOptions{})
} else {
err := gui.GitCommand.FastForward(branch.Name, remoteName, remoteBranchName, gui.promptUserForCredential)