Allow passing multiple options to control how wrapping is done
This commit is contained in:
@@ -35,7 +35,7 @@ func (self *Command) ShowVersion() {
|
||||
}
|
||||
|
||||
func format_with_indent(output io.Writer, text string, indent string, screen_width int) {
|
||||
indented := style.WrapText(text, indent, screen_width, "#placeholder_for_formatting#")
|
||||
indented := style.WrapText(text, screen_width, style.WrapOptions{Indent: indent, Ignore_lines_containing: "#placeholder_for_formatting#", Trim_whitespace: true})
|
||||
io.WriteString(output, indented)
|
||||
io.WriteString(output, "\n")
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func (self *Match) FormatForCompletionList(max_word_len int, f *markup.Context,
|
||||
word += strings.Repeat(" ", max_word_len-word_len)
|
||||
}
|
||||
if wcswidth.Stringwidth(desc) > max_desc_len {
|
||||
desc = style.WrapTextAsLines(desc, "", max_desc_len-2)[0] + "…"
|
||||
desc = style.WrapTextAsLines(desc, max_desc_len-2, style.WrapOptions{})[0] + "…"
|
||||
}
|
||||
if multiline {
|
||||
return word + "\n" + strings.Repeat(" ", max_word_len+2) + desc
|
||||
|
||||
Reference in New Issue
Block a user