Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-render hyperlinks #3914

Merged
merged 4 commits into from
Sep 28, 2024
Merged

Auto-render hyperlinks #3914

merged 4 commits into from
Sep 28, 2024

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

Add a facility to gocui.View to enable auto-rendering of https hyperlinks. Then, use it for the Command Log panel (as an alternative approach to #3911), and also in the status view and in confirmation popups to get rid of some code that used to do this manually.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@stefanhaller stefanhaller added the enhancement New feature or request label Sep 15, 2024
Copy link

codacy-production bot commented Sep 15, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for c6a77221 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (c6a7722) Report Missing Report Missing Report Missing
Head commit (825f5c0) 50572 43473 85.96%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#3914) 10 10 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@@ -171,6 +171,7 @@ func (gui *Gui) createAllViews() error {
gui.Views.Extras.Title = gui.c.Tr.CommandLog
gui.Views.Extras.Autoscroll = true
gui.Views.Extras.Wrap = true
gui.Views.Extras.AutoRenderHyperLinks = true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike in Aleksei's earlier PR, I decided to not set the UnderlineHyperLinksOnlyOnHover in this view, following the earlier decision to turn this on only in the main view, but underline links directly everywhere else. Let me know if you dislike this @jesseduffield.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine.

Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Some commands output hyperlinks, and it's useful to be able to click them.
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.
This allows us to get rid of the underlineLinks function.
@stefanhaller stefanhaller merged commit d11e11d into master Sep 28, 2024
15 checks passed
@stefanhaller stefanhaller deleted the auto-render-hyper-links branch September 28, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants