Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ func FormatBlockMessage(format string, msg string) string {
lines, maxLen := splitsBlockLines(msg, width-4) // 2 spaces on the left, 2 on the right
fullPadding := strings.Repeat(" ", maxLen+4)

buf.WriteString(fmt.Sprintf("<%s>", format))
fmt.Fprintf(&buf, "<%s>", format)
buf.WriteString(fullPadding)
buf.WriteString("</>\n")
for _, line := range lines {
buf.WriteString(fmt.Sprintf("<%s> ", format))
fmt.Fprintf(&buf, "<%s> ", format)
lenLine, _ := Stdout.GetFormatter().Format([]byte(line), &buf)
if n := maxLen - lenLine; n >= 0 {
buf.WriteString(strings.Repeat(" ", n))
}
buf.WriteString(" </>\n")
}
buf.WriteString(fmt.Sprintf("<%s>", format))
fmt.Fprintf(&buf, "<%s>", format)
buf.WriteString(fullPadding)
buf.WriteString("</>\n")

Expand Down
6 changes: 3 additions & 3 deletions style.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (s style) createBlock(messages []string, typePrefix, style, prefix string,

if padding {
if style != "" {
buf.WriteString(fmt.Sprintf("<%s>", style))
fmt.Fprintf(&buf, "<%s>", style)
}
buf.WriteString(fullPadding)
if style != "" {
Expand All @@ -117,7 +117,7 @@ func (s style) createBlock(messages []string, typePrefix, style, prefix string,

for i, line := range lines {
if style != "" {
buf.WriteString(fmt.Sprintf("<%s>", style))
fmt.Fprintf(&buf, "<%s>", style)
}

buf.WriteString(prefix)
Expand All @@ -143,7 +143,7 @@ func (s style) createBlock(messages []string, typePrefix, style, prefix string,

if padding {
if style != "" {
buf.WriteString(fmt.Sprintf("<%s>", style))
fmt.Fprintf(&buf, "<%s>", style)
}
buf.WriteString(fullPadding)
if style != "" {
Expand Down
Loading