Skip to content

Commit a29a624

Browse files
committed
wip
1 parent 75fd1bf commit a29a624

File tree

2 files changed

+13
-20
lines changed

2 files changed

+13
-20
lines changed

compiler/rustc_errors/src/emitter.rs

+11-19
Original file line numberDiff line numberDiff line change
@@ -1679,27 +1679,19 @@ impl EmitterWriter {
16791679
// Colorize addition/replacements with green.
16801680
for &SubstitutionHighlight { start, end } in highlight_parts {
16811681
// Account for tabs when highlighting (#87972).
1682-
let start: usize = line
1683-
.chars()
1684-
.take(start)
1685-
.map(|ch| match ch {
1686-
'\t' => 4,
1687-
_ => 1,
1688-
})
1689-
.sum();
1690-
1691-
let end: usize = line
1692-
.chars()
1693-
.take(end)
1694-
.map(|ch| match ch {
1695-
'\t' => 4,
1696-
_ => 1,
1697-
})
1698-
.sum();
1682+
// let tabs: usize = line
1683+
// .chars()
1684+
// .take(start)
1685+
// .map(|ch| match ch {
1686+
// '\t' => 3,
1687+
// _ => 0,
1688+
// })
1689+
// .sum();
1690+
let tabs = 0;
16991691
buffer.set_style_range(
17001692
row_num,
1701-
max_line_num_len + 3 + start,
1702-
max_line_num_len + 3 + end,
1693+
max_line_num_len + 3 + start + tabs,
1694+
max_line_num_len + 3 + end + tabs,
17031695
Style::Addition,
17041696
true,
17051697
);

compiler/rustc_errors/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extern crate rustc_macros;
1414

1515
pub use emitter::ColorConfig;
1616

17-
use tracing::debug;
17+
use tracing::{debug, info};
1818
use Level::*;
1919

2020
use emitter::{is_case_difference, Emitter, EmitterWriter};
@@ -349,6 +349,7 @@ impl CodeSuggestion {
349349
while buf.ends_with('\n') {
350350
buf.pop();
351351
}
352+
info!(?buf, ?highlights);
352353
Some((buf, substitution.parts, highlights, only_capitalization))
353354
})
354355
.collect()

0 commit comments

Comments
 (0)