1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-20 05:19:24 +02:00
lazygit/pkg/gui/remotes_panel.go

30 lines
681 B
Go
Raw Normal View History

2019-11-16 16:38:38 +11:00
package gui
import (
"fmt"
"strings"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/gui/types"
2019-11-16 16:38:38 +11:00
)
// list panel functions
func (gui *Gui) remotesRenderToMain() error {
var task types.UpdateTask
2022-02-05 17:04:10 +11:00
remote := gui.State.Contexts.Remotes.GetSelected()
2019-11-18 09:38:36 +11:00
if remote == nil {
task = types.NewRenderStringTask("No remotes")
2020-08-18 22:02:35 +10:00
} else {
task = types.NewRenderStringTask(fmt.Sprintf("%s\nUrls:\n%s", style.FgGreen.Sprint(remote.Name), strings.Join(remote.Urls, "\n")))
}
return gui.c.RenderToMainViews(types.RefreshMainOpts{
Pair: gui.c.MainViewPairs().Normal,
Main: &types.ViewUpdateOpts{
Title: "Remote",
Task: task,
2020-08-18 22:02:35 +10:00
},
})
2019-11-16 16:38:38 +11:00
}