From eec0fb23cfcf64cd2a5da78895112ce7fe3f1108 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Sat, 30 May 2020 21:56:10 -0400 Subject: Hack: add boolean to Style struct to identify non-emph styles This isn't a correct approach. The problem being addressed is that currently, Style instances are being used to represent things like the presence of an emph section in a line with edit annotations. A consequence is that if an emph and non-emph section are styled the same, then it's impossible to tell that the sections are different in any way at all. I think the correct approach is probably to start using a Struct that models elements such as emph/non-emph to represent these things, and make each such struct instance possess a style. --- src/paint.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/paint.rs') diff --git a/src/paint.rs b/src/paint.rs index b975193d..6a827e5d 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -417,6 +417,7 @@ mod superimpose_style_sections { is_underline: true, ..ansi_term::Style::new() }, + is_emph: false, is_omitted: false, is_raw: false, is_syntax_highlighted: true, @@ -431,6 +432,7 @@ mod superimpose_style_sections { is_underline: true, ..ansi_term::Style::new() }, + is_emph: false, is_omitted: false, is_raw: false, is_syntax_highlighted: false, @@ -445,6 +447,7 @@ mod superimpose_style_sections { is_underline: true, ..ansi_term::Style::new() }, + is_emph: false, is_omitted: false, is_raw: false, is_syntax_highlighted: true, -- cgit v1.2.3