From cd28b242ff84f85e6536af9ee6343308de5885d3 Mon Sep 17 00:00:00 2001 From: delthas Date: Sun, 31 Oct 2021 19:10:39 +0100 Subject: Mark hyperlinks with the OSC hyperlink terminal escape This makes multi-line links properly clickable. See: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda --- ui/buffers.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui/buffers.go') 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() } -- cgit v1.2.3