4

Account for tabs when highlighting multiline code suggestions by estebank · Pull...

 2 years ago
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.

Copy link

Collaborator

rust-highfive commented 16 days ago

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

.take(*start)

.map(|ch| match ch {

'\t' => 4,

_ => unicode_width::UnicodeWidthChar::width(ch).unwrap_or(1),

m-ou-se 16 days ago

edited

Member

I think this should just be 1. Counted in chars and not in columns.

Current nightly:

This PR:

(The second 'A' is a double-width 'A'.)

estebank 16 days ago

edited

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:

m-ou-se 16 days ago

Member

Yup, the highlighting looks good now!

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).

estebank 16 days ago

Author

Contributor

Sadly, now I'm seeing other issues :(

m-ou-se 16 days ago

Member

Here's the output in four more terminals:


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK