diff options
author | mjarkk <mkopenga@gmail.com> | 2018-12-10 14:21:00 +0100 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-12-10 14:21:00 +0100 |
commit | e20d8366e1fb971dfb8d8cb2f8aebd17366f14a5 (patch) | |
tree | 42f37938af5148cb652d43edba9db817e1aa564d /pkg | |
parent | 76e9582739c329fa657b327254bf010c560ac5e8 (diff) |
Made gobot happy
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/recent_repos_panel.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pkg/gui/recent_repos_panel.go b/pkg/gui/recent_repos_panel.go index 105d9b9cf..326d35b1e 100644 --- a/pkg/gui/recent_repos_panel.go +++ b/pkg/gui/recent_repos_panel.go @@ -15,7 +15,7 @@ type recentRepo struct { } // GetDisplayStrings returns the path from a recent repo. -func (r recentRepo) GetDisplayStrings() []string { +func (r *recentRepo) GetDisplayStrings() []string { yellow := color.New(color.FgMagenta) base := filepath.Base(r.path) path := yellow.Sprint(r.path) @@ -26,14 +26,14 @@ func (gui *Gui) handleCreateRecentReposMenu(g *gocui.Gui, v *gocui.View) error { recentRepoPaths := gui.Config.GetAppState().RecentRepos reposCount := utils.Min(len(recentRepoPaths), 20) // we won't show the current repo hence the -1 - recentRepos := make([]string, reposCount-1) - for i, repo := range recentRepoPaths[1:reposCount] { - recentRepos[i] = repo + recentRepos := make([]*recentRepo, reposCount-1) + for i, path := range recentRepoPaths[1:reposCount] { + recentRepos[i] = &recentRepo{path: path} } handleMenuPress := func(index int) error { - repoPath := recentRepos[index] - if err := os.Chdir(repoPath); err != nil { + repo := recentRepos[index] + if err := os.Chdir(repo.path); err != nil { return err } newGitCommand, err := commands.NewGitCommand(gui.Log, gui.OSCommand, gui.Tr) |