Fix formatting of lines with only spaces

This commit is contained in:
Kovid Goyal
2022-08-17 13:58:01 +05:30
parent 605882582e
commit 4596dc39ce
2 changed files with 17 additions and 7 deletions

View File

@@ -81,6 +81,10 @@ var blue_fmt = color.New(color.FgBlue).SprintFunc()
var green_fmt = color.New(color.FgGreen).SprintFunc()
func format_line_with_indent(output io.Writer, text string, indent string, screen_width int) {
if strings.TrimSpace(text) == "" {
fmt.Fprintln(output, indent)
return
}
x := len(indent)
fmt.Fprint(output, indent)
in_escape := 0