| 1 |
[1mdiff --cc src/paint.rs[m |
| 2 |
[1mindex 79b44db1,0f429d5c..00000000[m |
| 3 |
[1m--- a/src/paint.rs[m |
| 4 |
[1m+++ b/src/paint.rs[m |
| 5 |
[36m@@@ -387,30 -457,36 +387,88 @@@[m [mimpl<'p> Painter<'p> [m |
| 6 |
) -> (Option<BgFillMethod>, Style) {[m |
| 7 |
// style: for right fill if line contains no emph sections[m |
| 8 |
// non_emph_style: for right fill if line contains emph sections[m |
| 9 |
[32m++<<<<<<< HEAD[m |
| 10 |
[32m + let (style, non_emph_style) = match state {[m |
| 11 |
[32m + State::HunkMinus(None) | State::HunkMinusWrapped => {[m |
| 12 |
[32m + (config.minus_style, config.minus_non_emph_style)[m |
| 13 |
[32m + }[m |
| 14 |
[32m + State::HunkZero | State::HunkZeroWrapped => (config.zero_style, config.zero_style),[m |
| 15 |
[32m + State::HunkPlus(None) | State::HunkPlusWrapped => {[m |
| 16 |
[32m + (config.plus_style, config.plus_non_emph_style)[m |
| 17 |
[32m + }[m |
| 18 |
[32m + State::HunkMinus(Some(_)) | State::HunkPlus(Some(_)) => {[m |
| 19 |
[32m + let style = if !diff_sections.is_empty() {[m |
| 20 |
[32m + diff_sections[diff_sections.len() - 1].0[m |
| 21 |
[32m++||||||| parent of 4d4b19ca (Always use non-emph style for right fill)[m |
| 22 |
[32m++ let (style, non_emph_style) = match state {[m |
| 23 |
[32m++ State::HunkMinus(None) | State::HunkMinusWrapped => {[m |
| 24 |
[32m++ (config.minus_style, config.minus_non_emph_style)[m |
| 25 |
[32m++ }[m |
| 26 |
[32m++ State::HunkMinus(Some(raw_line)) => {[m |
| 27 |
[32m++ // TODO: This is the second time we are parsing the ANSI sequences[m |
| 28 |
[32m++ if let Some(ansi_term_style) = ansi::parse_first_style(raw_line) {[m |
| 29 |
[32m++ let style = Style {[m |
| 30 |
[32m++ ansi_term_style,[m |
| 31 |
[32m++ ..Style::new()[m |
| 32 |
[32m++ };[m |
| 33 |
[32m++ (style, style)[m |
| 34 |
[32m++ } else {[m |
| 35 |
[32m++ (config.minus_style, config.minus_non_emph_style)[m |
| 36 |
[32m++ }[m |
| 37 |
[32m++ }[m |
| 38 |
[32m++ State::HunkZero | State::HunkZeroWrapped => (config.zero_style, config.zero_style),[m |
| 39 |
[32m++ State::HunkPlus(None) | State::HunkPlusWrapped => {[m |
| 40 |
[32m++ (config.plus_style, config.plus_non_emph_style)[m |
| 41 |
[32m++ }[m |
| 42 |
[32m++ State::HunkPlus(Some(raw_line)) => {[m |
| 43 |
[32m++ // TODO: This is the second time we are parsing the ANSI sequences[m |
| 44 |
[32m++ if let Some(ansi_term_style) = ansi::parse_first_style(raw_line) {[m |
| 45 |
[32m++ let style = Style {[m |
| 46 |
[32m++ ansi_term_style,[m |
| 47 |
[32m++ ..Style::new()[m |
| 48 |
[32m++ };[m |
| 49 |
[32m++ (style, style)[m |
| 50 |
[32m++=======[m |
| 51 |
[32m+ let non_emph_style = match state {[m |
| 52 |
[32m+ State::HunkMinus(None) | State::HunkMinusWrapped => config.minus_non_emph_style,[m |
| 53 |
[32m+ State::HunkMinus(Some(raw_line)) => {[m |
| 54 |
[32m+ // TODO: This is the second time we are parsing the ANSI sequences[m |
| 55 |
[32m+ if let Some(ansi_term_style) = ansi::parse_first_style(raw_line) {[m |
| 56 |
[32m+ Style {[m |
| 57 |
[32m+ ansi_term_style,[m |
| 58 |
[32m+ ..Style::new()[m |
| 59 |
[32m+ }[m |
| 60 |
[32m+ } else {[m |
| 61 |
[32m+ config.minus_non_emph_style[m |
| 62 |
[32m+ }[m |
| 63 |
[32m+ }[m |
| 64 |
[32m+ State::HunkZero | State::HunkZeroWrapped => config.zero_style,[m |
| 65 |
[32m+ State::HunkPlus(None) | State::HunkPlusWrapped => config.plus_non_emph_style,[m |
| 66 |
[32m+ State::HunkPlus(Some(raw_line)) => {[m |
| 67 |
[32m+ // TODO: This is the second time we are parsing the ANSI sequences[m |
| 68 |
[32m+ if let Some(ansi_term_style) = ansi::parse_first_style(raw_line) {[m |
| 69 |
[32m+ Style {[m |
| 70 |
[32m+ ansi_term_style,[m |
| 71 |
[32m+ ..Style::new()[m |
| 72 |
[32m+ }[m |
| 73 |
[32m++>>>>>>> 4d4b19ca (Always use non-emph style for right fill)[m |
| 74 |
} else {[m |
| 75 |
[32m++<<<<<<< HEAD[m |
| 76 |
[32m + config.null_style[m |
| 77 |
[32m + };[m |
| 78 |
[32m + (style, style)[m |
| 79 |
[32m++||||||| parent of 4d4b19ca (Always use non-emph style for right fill)[m |
| 80 |
[32m++ (config.plus_style, config.plus_non_emph_style)[m |
| 81 |
[32m++ }[m |
| 82 |
[32m++=======[m |
| 83 |
[32m+ config.plus_non_emph_style[m |
| 84 |
[32m+ }[m |
| 85 |
[32m++>>>>>>> 4d4b19ca (Always use non-emph style for right fill)[m |
| 86 |
}[m |
| 87 |
[31m- State::Blame(_, _) => (diff_sections[0].0, diff_sections[0].0),[m |
| 88 |
[31m- _ => (config.null_style, config.null_style),[m |
| 89 |
[31m- };[m |
| 90 |
[31m- let fill_style = if style_sections_contain_more_than_one_style(diff_sections) {[m |
| 91 |
[31m- non_emph_style // line contains an emph section[m |
| 92 |
[31m- } else {[m |
| 93 |
[31m- style[m |
| 94 |
[32m+ State::Blame(_, _) => diff_sections[0].0,[m |
| 95 |
[32m+ _ => config.null_style,[m |
| 96 |
};[m |
| 97 |
[32m+ let fill_style = non_emph_style;[m |
| 98 |
[m |
| 99 |
match ([m |
| 100 |
fill_style.get_background_color().is_some(),[m |