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

28 lines
560 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"
2019-11-16 07:38:38 +02:00
)
// list panel functions
func (gui *Gui) remotesRenderToMain() error {
2020-08-18 14:02:35 +02:00
var task 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 {
2021-04-04 15:51:59 +02:00
task = NewRenderStringTask("No remotes")
2020-08-18 14:02:35 +02:00
} else {
task = NewRenderStringTask(fmt.Sprintf("%s\nUrls:\n%s", style.FgGreen.Sprint(remote.Name), strings.Join(remote.Urls, "\n")))
}
2020-08-23 01:46:28 +02:00
return gui.refreshMainViews(refreshMainOpts{
2020-08-18 14:02:35 +02:00
main: &viewUpdateOpts{
title: "Remote",
task: task,
},
})
2019-11-16 07:38:38 +02:00
}