mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-26 10:12:17 +02:00
Dont make urls part of styling, instead have a dedicated UrlFunc API
Since urls can potentially change a lot, caching them makes no sense
This commit is contained in:
@@ -298,7 +298,6 @@ func (self *sgr_code) update() {
|
||||
func parse_spec(spec string) []escape_code {
|
||||
ans := make([]escape_code, 0, 1)
|
||||
sgr := sgr_code{}
|
||||
url := url_code{}
|
||||
sparts, _ := shlex.Split(spec)
|
||||
for _, p := range sparts {
|
||||
parts := strings.SplitN(p, "=", 2)
|
||||
@@ -326,17 +325,12 @@ func parse_spec(spec string) []escape_code {
|
||||
sgr.underline.from_string(val)
|
||||
case "ucol", "underline_color", "uc":
|
||||
sgr.uc.from_string(val)
|
||||
case "url":
|
||||
url.url = val
|
||||
}
|
||||
}
|
||||
sgr.update()
|
||||
if !sgr.is_empty() {
|
||||
ans = append(ans, &sgr)
|
||||
}
|
||||
if !url.is_empty() {
|
||||
ans = append(ans, &url)
|
||||
}
|
||||
return ans
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user