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

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