summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorFrancisco Miamoto <francisco@dorayaki.co>2021-10-28 20:21:07 -0300
committerJesse Duffield <jessedduffield@gmail.com>2021-12-26 17:08:31 +1100
commit8c8b925b3a122624ed860b76510a8108e34193d9 (patch)
treef9b2d0d87bb069bc8b6eabbd3c996d83a322581e /pkg
parentb8735cc6096200aaf8dfd0365357545b840d95fa (diff)
set tag index directly
We can do this since they are already sorted by date created.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/gui/commits_panel.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go
index 69765b8a5..01039e028 100644
--- a/pkg/gui/commits_panel.go
+++ b/pkg/gui/commits_panel.go
@@ -607,18 +607,8 @@ func (gui *Gui) createTagMenu(commitSha string) error {
}
func (gui *Gui) afterTagCreate(tagName string) error {
- return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{COMMITS, TAGS}, then: func() {
- // find the index of the tag and set that as the currently selected line
- for i, tag := range gui.State.Tags {
- if tag.Name == tagName {
- gui.State.Panels.Tags.SelectedLineIdx = i
- if err := gui.State.Contexts.Tags.HandleRender(); err != nil {
- gui.Log.Error(err)
- }
- return
- }
- }
- }})
+ gui.State.Panels.Tags.SelectedLineIdx = 0 // Set to the top
+ return gui.refreshSidePanels(refreshOptions{mode: ASYNC, scope: []RefreshableView{COMMITS, TAGS}})
}
func (gui *Gui) handleCreateAnnotatedTag(commitSha string) error {