summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordelthas <delthas@dille.cc>2022-10-14 11:19:42 +0200
committerdelthas <delthas@dille.cc>2022-10-14 11:19:42 +0200
commitd242b4f3e446a9950f007810b710bd240e4f623f (patch)
tree98d82da668a2c1f61d67e9a59ec6824c463ca5ed
parentScroll to buffer on zoom (diff)
Switch to the upstream tcell implementation of OSC 8 hyperlink
tcell has merged OSC support in [1], with support for more terminals than what was added in the tcell fork we used. Now, all terminals with mouse sequences support should receive OSC 8 hyperlinks sequences. [1]: https://github.com/gdamore/tcell/pull/527/commits/e7b14a71dc78721c0f007fd6197262c52c1d4df9 Fixes: https://todo.sr.ht/~taiite/senpai/103
-rw-r--r--go.mod4
-rw-r--r--go.sum8
-rw-r--r--ui/style.go8
3 files changed, 9 insertions, 11 deletions
diff --git a/go.mod b/go.mod
index 51d22a5..7f13976 100644
--- a/go.mod
+++ b/go.mod
@@ -4,12 +4,10 @@ go 1.16
require (
git.sr.ht/~emersion/go-scfg v0.0.0-20201019143924-142a8aa629fc
- github.com/gdamore/tcell/v2 v2.3.11
+ github.com/gdamore/tcell/v2 v2.5.4-0.20220911202027-96bb70f9efec
github.com/mattn/go-runewidth v0.0.13
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
mvdan.cc/xurls/v2 v2.3.0
)
-
-replace github.com/gdamore/tcell/v2 => github.com/delthas/tcell/v2 v2.4.1-0.20220223131437-2362f49a2b6c
diff --git a/go.sum b/go.sum
index 66f8e1d..3cebc2e 100644
--- a/go.sum
+++ b/go.sum
@@ -2,10 +2,10 @@ git.sr.ht/~emersion/go-scfg v0.0.0-20201019143924-142a8aa629fc h1:51BD67xFX+bozd
git.sr.ht/~emersion/go-scfg v0.0.0-20201019143924-142a8aa629fc/go.mod h1:t+Ww6SR24yYnXzEWiNlOY0AFo5E9B73X++10lrSpp4U=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/delthas/tcell/v2 v2.4.1-0.20220223131437-2362f49a2b6c h1:CDBsRiU7tJJ5zD38/jHNShfWFJP2lctZF7v0z1ASrtg=
-github.com/delthas/tcell/v2 v2.4.1-0.20220223131437-2362f49a2b6c/go.mod h1:Az6Jt+M5idSED2YPGtwnfJV0kXohgdCBPmHGSYc1r04=
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg=
+github.com/gdamore/tcell/v2 v2.5.4-0.20220911202027-96bb70f9efec h1:wvcbNOhEpZhHp4F9eIvB7fn0CDsQt9EXlHHyvxfb284=
+github.com/gdamore/tcell/v2 v2.5.4-0.20220911202027-96bb70f9efec/go.mod h1:wSkrPaXoiIWZqW/g7Px4xc79di6FTcpB8tvaKJ6uGBo=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
@@ -23,13 +23,13 @@ golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacp
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220318055525-2edf467146b5 h1:saXMvIOKvRFwbOMicHXr0B1uwoxq9dGmLe5ExMES6c4=
+golang.org/x/sys v0.0.0-20220318055525-2edf467146b5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6 h1:Vv0JUPWTyeqUq42B2WJ1FeIDjjvGKoA2Ss+Ts0lAVbs=
diff --git a/ui/style.go b/ui/style.go
index 544cca5..cb24304 100644
--- a/ui/style.go
+++ b/ui/style.go
@@ -149,7 +149,7 @@ func (s StyledString) ParseURLs() StyledString {
}
if st.Start == ub {
// a style already starts at this position, edit it
- lastStyle.Style = lastStyle.Style.Hyperlink(link)
+ lastStyle.Style = lastStyle.Style.Url(link)
}
lastStyle = st
styles = append(styles, st)
@@ -158,7 +158,7 @@ func (s StyledString) ParseURLs() StyledString {
// no style existed at this position, add one from the last style
styles = append(styles, rangedStyle{
Start: ub,
- Style: lastStyle.Style.Hyperlink(link),
+ Style: lastStyle.Style.Url(link),
})
}
// find last style starting before or at url end
@@ -168,7 +168,7 @@ func (s StyledString) ParseURLs() StyledString {
break
}
if st.Start < ue {
- st.Style = st.Style.Hyperlink(link)
+ st.Style = st.Style.Url(link)
}
lastStyle = st
styles = append(styles, st)
@@ -177,7 +177,7 @@ func (s StyledString) ParseURLs() StyledString {
// no style existed at this position, add one from the last style without the hyperlink
styles = append(styles, rangedStyle{
Start: ue,
- Style: lastStyle.Style.Hyperlink(""),
+ Style: lastStyle.Style.Url(""),
})
}
}