diff options
author | Dan Davison <dandavison7@gmail.com> | 2020-06-16 10:18:24 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2020-06-17 09:03:38 -0400 |
commit | 5d5b4a3995e109b24b420daa094773ac4e6dc5bf (patch) | |
tree | 9742c993efdbd75fa6316d683975fa81a36bd206 /src/paint.rs | |
parent | 47f963639aa5ee3e7d4b82ab846878350ef5999b (diff) |
Eliminate leading space unless --keep-plus-minus-markers
Diffstat (limited to 'src/paint.rs')
-rw-r--r-- | src/paint.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/paint.rs b/src/paint.rs index d1505c74..62a7f64f 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -22,7 +22,7 @@ pub struct Painter<'a> { pub writer: &'a mut dyn Write, pub syntax: &'a SyntaxReference, pub highlighter: HighlightLines<'a>, - pub config: &'a config::Config<'a>, + pub config: &'a config::Config, pub output_buffer: String, pub minus_line_number: usize, pub plus_line_number: usize, @@ -96,7 +96,11 @@ impl<'a> Painter<'a> { minus_line_numbers, &mut self.output_buffer, self.config, - self.config.minus_line_marker, + if self.config.keep_plus_minus_markers { + "-" + } else { + "" + }, self.config.minus_style, self.config.minus_non_emph_style, None, @@ -109,7 +113,11 @@ impl<'a> Painter<'a> { plus_line_numbers, &mut self.output_buffer, self.config, - self.config.plus_line_marker, + if self.config.keep_plus_minus_markers { + "+" + } else { + "" + }, self.config.plus_style, self.config.plus_non_emph_style, None, |