(sb *strings.Builder, color ColorConfig)
| 382 | } |
| 383 | |
| 384 | func (o *op) writeTo(sb *strings.Builder, color ColorConfig) { |
| 385 | colorKey := operationColorKey[o.t] |
| 386 | sb.WriteString(color[colorKey]) |
| 387 | sb.WriteByte(operationChar[o.t]) |
| 388 | if strings.HasSuffix(o.text, "\n") { |
| 389 | sb.WriteString(strings.TrimSuffix(o.text, "\n")) |
| 390 | } else { |
| 391 | sb.WriteString(o.text + "\n\\ No newline at end of file") |
| 392 | } |
| 393 | sb.WriteString(color.Reset(colorKey)) |
| 394 | sb.WriteByte('\n') |
| 395 | } |