diff options
author | delthas <delthas@dille.cc> | 2021-10-31 19:10:39 +0100 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-10-31 19:57:01 +0100 |
commit | cd28b242ff84f85e6536af9ee6343308de5885d3 (patch) | |
tree | f741db49302f67f9aa6c7b9df021394581ecb8aa /ui/buffers.go | |
parent | /mode: default channel to the current channel (diff) |
Mark hyperlinks with the OSC hyperlink terminal escape
This makes multi-line links properly clickable.
See: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
Diffstat (limited to 'ui/buffers.go')
-rw-r--r-- | ui/buffers.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/buffers.go b/ui/buffers.go index 8285fc6..3e13302 100644 --- a/ui/buffers.go +++ b/ui/buffers.go @@ -302,6 +302,10 @@ func (bs *BufferList) AddLine(netID, title string, notify NotifyType, line Line) n := len(b.lines) line.At = line.At.UTC() + if !line.Mergeable { + line.Body = line.Body.ParseURLs() + } + if line.Mergeable && n != 0 && b.lines[n-1].Mergeable { l := &b.lines[n-1] newBody := new(StyledStringBuilder) @@ -338,9 +342,11 @@ func (bs *BufferList) AddLines(netID, title string, before, after []Line) { b := &bs.list[idx] for i := 0; i < len(before); i++ { + before[i].Body = before[i].Body.ParseURLs() before[i].computeSplitPoints() } for i := 0; i < len(after); i++ { + after[i].Body = after[i].Body.ParseURLs() after[i].computeSplitPoints() } |