aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax_highlighting.rs
diff options
context:
space:
mode:
authorJonas Maier <>2026-05-24 18:02:04 +0200
committerJonas Maier <>2026-05-24 18:02:04 +0200
commit01a198b8ad42680c9333039c75317d1787120c78 (patch)
tree96fac6e66a4f454ba0d6a4fc6d61226346c3258a /src/syntax_highlighting.rs
parent52e97864d483f1f442e96058a17c159c5be10db3 (diff)
downloadpish-01a198b8ad42680c9333039c75317d1787120c78.tar.gz
better multiline handling
Diffstat (limited to 'src/syntax_highlighting.rs')
-rw-r--r--src/syntax_highlighting.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/syntax_highlighting.rs b/src/syntax_highlighting.rs
index 1a6e626..043509a 100644
--- a/src/syntax_highlighting.rs
+++ b/src/syntax_highlighting.rs
@@ -124,7 +124,11 @@ impl Highlighter {
}
}
- stdout.write_all(&[x])?;
+ if x == b'\n' {
+ stdout.write_all(b"\r\n")?;
+ } else {
+ stdout.write_all(&[x])?;
+ }
}
stdout.write_all(self.color(HighlightKind::None))?;