Skip to content

Commit

Permalink
feat: hyperlink only when upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
lnu committed Jan 2, 2021
1 parent 0707831 commit effc79d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/segment_git.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (g *git) string() string {
if g.repo.upstream != "" && g.props.getBool(DisplayUpstreamIcon, false) {
fmt.Fprintf(buffer, "%s", g.getUpstreamSymbol(g.repo.url))
}
if enableHyperlink {
if g.repo.upstream != "" && enableHyperlink {
url := strings.Replace(g.repo.url, ".git", "", -1)
fmt.Fprintf(buffer, "]8;;%s\\%s]8;;\\", fmt.Sprintf("%s/tree/%s", url, g.repo.HEAD), g.repo.PRETTYHEAD)
} else {
Expand Down

0 comments on commit effc79d

Please sign in to comment.