summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-11-01 19:00:20 -0500
committerDan Davison <dandavison7@gmail.com>2020-11-01 19:32:23 -0500
commit45422c99fa0b4444ff276b452ce9b3f70e0d0339 (patch)
treeece67f2394adf80ad9a78dab58d2c91066ac510e
parentc1edd6dbb4068e032c96462e665831d282b09d16 (diff)
Do not strip leading +/- under keep-plus-minus-markers
Ref #371
-rw-r--r--src/paint.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/paint.rs b/src/paint.rs
index d31868c0..e69ebeee 100644
--- a/src/paint.rs
+++ b/src/paint.rs
@@ -104,7 +104,14 @@ impl<'a> Painter<'a> {
/// Remove the initial +/- character of a line that will be emitted unchanged, including any
/// ANSI escape sequences.
pub fn prepare_raw_line(&self, line: &str) -> String {
- ansi::ansi_preserving_slice(&self.expand_tabs(line.graphemes(true)), 1)
+ ansi::ansi_preserving_slice(
+ &self.expand_tabs(line.graphemes(true)),
+ if self.config.keep_plus_minus_markers {
+ 0
+ } else {
+ 1
+ },
+ )
}
/// Expand tabs as spaces.