summaryrefslogtreecommitdiffstats
path: root/src/delta.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-04-11 23:03:14 -0400
committerDan Davison <dandavison7@gmail.com>2020-04-12 00:47:34 -0400
commitc0ed54cefa987a9df29352653f6becd824434713 (patch)
tree538d6006e5c40e0b23f90adb312590b8d86bc69e /src/delta.rs
parentdefc0eadff002ba94269637f38f0e342ec823aff (diff)
Horrible hack working around my failure to fix a bug properly
At the parent commit da473302, some lines are being incorrectly truncated at word boundaries. It's something to do with an interaction between (a) the changes made in da473302 in order to implement --retain-plus-minus-markers, and (b) the logic in tokenize(). This commit works around that by reinstating the leading space character during tokenization and syntax highlighting, and then removing it afterwards in a hacky way.
Diffstat (limited to 'src/delta.rs')
-rw-r--r--src/delta.rs2
1 files changed, 1 insertions, 1 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()
}