summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-08-01 21:34:04 -0400
committerDan Davison <dandavison7@gmail.com>2020-08-01 21:47:45 -0400
commitde1364ccc5e7cf08f7321c67c7baf3c8770d69df (patch)
treefaaa91f4e8c3509e2dbd22d8eab94771b38cfe51 /src
parent37d5bce6dfbf0f6b3cc29cb5221c3d93bb978faa (diff)
Bug fix: honor blink attributes in ANSI parser
Before this, setting `color.diff.old = blink` broke Delta as follows: - Git outputs SGR attribute 5 (blink slow) - Delta at start-up parsed that style string (using Delta's style string parsing code) to a style object without the blink flag set - Subsequently, Delta encountered the ANSI sequences in the raw line from Git and parsed them using vte to a style object with the blink flag set - The two compared unequal, triggering Delta to think that it had seen a line that was not a normal minus line. When Delta reaches that conclusion, it (per d9a07679df and surrounding commits) outputs the raw line with its ANSI sequences intact, rather than creating the usual Delta output for that line.
Diffstat (limited to 'src')
-rw-r--r--src/ansi/parse.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ansi/parse.rs b/src/ansi/parse.rs
index bd9b899c..60973b94 100644
--- a/src/ansi/parse.rs
+++ b/src/ansi/parse.rs
@@ -66,8 +66,8 @@ fn ansi_term_style_from_sgr_parameters(parameters: &[i64]) -> ansi_term::Style {
2 => style.is_dimmed = true,
3 => style.is_italic = true,
4 => style.is_underline = true,
- // 5 => Some(Attr::BlinkSlow),
- // 6 => Some(Attr::BlinkFast),
+ 5 => style.is_blink = true, // blink slow
+ 6 => style.is_blink = true, // blink fast
7 => style.is_reverse = true,
8 => style.is_hidden = true,
9 => style.is_strikethrough = true,