on main help sign in
chore(diffview): `TrimSuffix` -> `TrimRight`
5c9f168Andrey Nering
internal/tui/exp/diffview/chroma.go+1−1
@@ -22,7 +22,7 @@ type chromaFormatter struct {
22// Format implements the chroma.Formatter interface.
22// Format implements the chroma.Formatter interface.
23func (c chromaFormatter) Format(w io.Writer, style *chroma.Style, it chroma.Iterator) error {
23func (c chromaFormatter) Format(w io.Writer, style *chroma.Style, it chroma.Iterator) error {
24 for token := it(); token != chroma.EOF; token = it() {
24 for token := it(); token != chroma.EOF; token = it() {
25− value := strings.TrimSuffix(token.Value, "\n")
25+ value := strings.TrimRight(token.Value, "\n")
26 value = ansiext.Escape(value)
26 value = ansiext.Escape(value)
27
27
28 entry := style.Get(token.Type)
28 entry := style.Get(token.Type)