summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/delta.rs2
-rw-r--r--src/paint.rs9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/delta.rs b/src/delta.rs
index 49dbb2d1..ae6fd744 100644
--- a/src/delta.rs
+++ b/src/delta.rs
@@ -369,7 +369,7 @@ fn prepare(line: &str, append_newline: bool, config: &Config) -> String {
} else {
line.collect::<String>()
};
- format!("{}{}", output_line, terminator)
+ format!(" {}{}", output_line, terminator)
} else {
terminator.to_string()
}
diff --git a/src/paint.rs b/src/paint.rs
index a65ff00d..6ae052b4 100644
--- a/src/paint.rs
+++ b/src/paint.rs
@@ -118,7 +118,14 @@ impl<'a> Painter<'a> {
if prefix != "" {
ansi_strings.push(background_ansi_style.paint(prefix));
}
- for (style, text) in superimpose_style_sections(syntax_sections, diff_sections) {
+ let mut dropped_prefix = prefix == ""; // TODO: Hack
+ for (style, mut text) in superimpose_style_sections(syntax_sections, diff_sections) {
+ if !dropped_prefix {
+ if text.len() > 0 {
+ text.remove(0);
+ }
+ dropped_prefix = true;
+ }
if config.width.is_some() {
text_width += text.graphemes(true).count();
}