diff options
author | Francisco Miamoto <francisco@dorayaki.co> | 2021-10-28 20:21:07 -0300 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-12-26 17:08:31 +1100 |
commit | 8c8b925b3a122624ed860b76510a8108e34193d9 (patch) | |
tree | f9b2d0d87bb069bc8b6eabbd3c996d83a322581e | |
parent | b8735cc6096200aaf8dfd0365357545b840d95fa (diff) |
set tag index directly
We can do this since they are already sorted by date created.
-rw-r--r-- | pkg/gui/commits_panel.go | 14 |
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 { |