1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-12 11:15:00 +02:00
lazygit/pkg/gui/remotes_panel.go

30 lines
681 B
Go
Raw Normal View History

2019-11-16 07:38:38 +02:00
package gui
import (
"fmt"
"strings"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/gui/types"
2019-11-16 07:38:38 +02:00
)
// list panel functions
func (gui *Gui) remotesRenderToMain() error {
var task types.UpdateTask
2022-02-05 08:04:10 +02:00
remote := gui.State.Contexts.Remotes.GetSelected()
2019-11-18 00:38:36 +02:00
if remote == nil {
task = types.NewRenderStringTask("No remotes")
2020-08-18 14:02:35 +02: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 14:02:35 +02:00
},
})
2019-11-16 07:38:38 +02:00
}