Dont output escape strings in descriptions

This commit is contained in:
Kovid Goyal 2022-09-19 20:32:10 +05:30
parent e3b8de1ac0
commit a2bb360eec
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -68,7 +68,6 @@ func fmt_desc(word, desc string, max_word_len int, f *markup.Context, screen_wid
if wcswidth.Stringwidth(desc) > max_desc_len { if wcswidth.Stringwidth(desc) > max_desc_len {
desc = wcswidth.TruncateToVisualLength(desc, max_desc_len-2) + "…" desc = wcswidth.TruncateToVisualLength(desc, max_desc_len-2) + "…"
} }
if multiline { if multiline {
return word + "\n " + desc return word + "\n " + desc
} }
@ -131,12 +130,9 @@ func zsh_output_serializer(completions []*Completions, shell_state map[string]st
ctty.Close() ctty.Close()
if err == nil { if err == nil {
screen_width = int(sz.Col) screen_width = int(sz.Col)
f = markup.New(true)
} }
} }
if f == nil { f = markup.New(false) // ZSH freaks out if there are escape codes in the description strings
f = markup.New(false)
}
return serialize(completions[0], f, screen_width) return serialize(completions[0], f, screen_width)
} }