Skip to content

Commit

Permalink
Use preformatted_text color for rendering plain text files (#351)
Browse files Browse the repository at this point in the history
Using a color from the theme should make the rendering of text
files be more in line with the colors chosen for styled content.
Furthermore, allowing some form of user override for the color
of plain text files allows users to individually fix bad color
combinations. Such as in my case, where the combination of a
solarized terminal theme and the default color chosen by amfora
causes plain text files to be rendered as white text on an almost
equally bright background.
  • Loading branch information
seifferth authored Dec 18, 2024
1 parent b4aa0bc commit 1115614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion renderer/renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func RenderPlainText(s string) string {
// It used to add a left margin, now this is done elsewhere.
// The function is kept for convenience and in case rendering
// is needed in the future.
return cview.Escape(s)
return fmt.Sprintf("[%s]", config.GetColorString("preformatted_text")) + cview.Escape(s)
}

// wrapLine wraps a line to the provided width, and adds the provided prefix and suffix to each wrapped line.
Expand Down

0 comments on commit 1115614

Please sign in to comment.