Ensure active hyperlink is cleared when truncating output for completion descriptions

This commit is contained in:
Kovid Goyal 2022-11-16 20:32:42 +05:30
parent d4c103e53e
commit 5e880b92f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -67,7 +67,7 @@ func (self *Match) FormatForCompletionList(max_word_len int, f *markup.Context,
word += strings.Repeat(" ", max_word_len-word_len) word += strings.Repeat(" ", max_word_len-word_len)
} }
if wcswidth.Stringwidth(desc) > max_desc_len { if wcswidth.Stringwidth(desc) > max_desc_len {
desc = wcswidth.TruncateToVisualLength(desc, max_desc_len-2) + "\x1b[m…" desc = wcswidth.TruncateToVisualLength(desc, max_desc_len-2) + "\x1b[m\x1b]8;;\x1b\\…"
} }
if multiline { if multiline {
return word + "\n" + strings.Repeat(" ", max_word_len+2) + desc return word + "\n" + strings.Repeat(" ", max_word_len+2) + desc