Account for tabs when highlighting multiline code suggestions by estebank · Pull...
source link: https://github.com/rust-lang/rust/pull/87976
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
r? @cjgillot
(rust-highfive has picked a reviewer for you, use r? to override)
compiler/rustc_errors/src/emitter.rs
Outdated
.take(*start)
.map(|ch| match ch {
'\t' => 4,
_ => unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1),
m-ou-se 16 days ago •
Member
I think this should just be 1. Counted in char
s and not in columns.
Current nightly:
This PR:
(The second 'A' is a double-width 'A'.)
estebank 16 days ago •
Author
Contributor
Can you verify the current version of the PR against your test cases? Sadly, we don't currently have regression tests for the coloring of the output in our tests :-/
This is what I'm seeing in my local tests:
estebank 16 days ago
Author
Contributor
In particular, I want to confirm that the output of the terminal without emoji support you showed here is reasonable (as I fully expect it to be, because it relies on what we were doing for the multiline case, which looks ok in that screenshot).
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK