From 26e3a93fc3ce88180e15224a1bdca54436045484 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 15 Sep 2024 14:12:41 +0200 Subject: [PATCH] Use AutoRenderHyperLinks in main views This allows clicking on links in commit messages, for examples. It also affects the status view, so we can get rid of the manual hyperlinking there. --- pkg/gui/controllers/status_controller.go | 12 ++++++------ pkg/gui/views.go | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg/gui/controllers/status_controller.go b/pkg/gui/controllers/status_controller.go index c15e85f8c..68028302f 100644 --- a/pkg/gui/controllers/status_controller.go +++ b/pkg/gui/controllers/status_controller.go @@ -208,12 +208,12 @@ func (self *StatusController) showDashboard() { []string{ lazygitTitle(), fmt.Sprintf("Copyright %d Jesse Duffield", time.Now().Year()), - fmt.Sprintf("Keybindings: %s", style.PrintSimpleHyperlink(fmt.Sprintf(constants.Links.Docs.Keybindings, versionStr))), - fmt.Sprintf("Config Options: %s", style.PrintSimpleHyperlink(fmt.Sprintf(constants.Links.Docs.Config, versionStr))), - fmt.Sprintf("Tutorial: %s", style.PrintSimpleHyperlink(constants.Links.Docs.Tutorial)), - fmt.Sprintf("Raise an Issue: %s", style.PrintSimpleHyperlink(constants.Links.Issues)), - fmt.Sprintf("Release Notes: %s", style.PrintSimpleHyperlink(constants.Links.Releases)), - style.FgMagenta.Sprintf("Become a sponsor: %s", style.PrintSimpleHyperlink(constants.Links.Donate)), // caffeine ain't free + fmt.Sprintf("Keybindings: %s", fmt.Sprintf(constants.Links.Docs.Keybindings, versionStr)), + fmt.Sprintf("Config Options: %s", fmt.Sprintf(constants.Links.Docs.Config, versionStr)), + fmt.Sprintf("Tutorial: %s", constants.Links.Docs.Tutorial), + fmt.Sprintf("Raise an Issue: %s", constants.Links.Issues), + fmt.Sprintf("Release Notes: %s", constants.Links.Releases), + style.FgMagenta.Sprintf("Become a sponsor: %s", constants.Links.Donate), // caffeine ain't free }, "\n\n") + "\n" self.c.RenderToMainViews(types.RefreshMainOpts{ diff --git a/pkg/gui/views.go b/pkg/gui/views.go index 839fe15fc..c7b5e40ff 100644 --- a/pkg/gui/views.go +++ b/pkg/gui/views.go @@ -118,6 +118,7 @@ func (gui *Gui) createAllViews() error { view.Wrap = true view.IgnoreCarriageReturns = true view.UnderlineHyperLinksOnlyOnHover = true + view.AutoRenderHyperLinks = true } gui.Views.Staging.Title = gui.c.Tr.UnstagedChanges