Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(render): Fold like rustc #111

Merged
merged 1 commit into from
Mar 21, 2024
Merged

fix(render): Fold like rustc #111

merged 1 commit into from
Mar 21, 2024

Conversation

epage
Copy link
Contributor

@epage epage commented Mar 21, 2024

Before, we elided all small sets of unhighlighted lines and then partially elided large sets of unhighlighted lines (favoring the start).

In contrast, rustc shows 2 lines of context, split between the start and end of the fold.
If there are 3 unhighlighted lines, it just skips folding. This makes a lot more sense.
See https://github.com/rust-lang/rust/blob/2627e9f3012a97d3136b3e11bf6bd0853c38a534/compiler/rustc_errors/src/emitter.rs#L1878C17-L1939C18

In contrast to rustc, I made the amount of context a variable to make the intent clearer and to open the door to it being configurable.

Before, we elided all small sets of unhighlighted lines and then
partially elided large sets of unhighlighted lines (favoring the start).

In contrast, rustc shows 2 lines of context, split between the start and
end of the fold.
If there are 3 unhighlighted lines, it just skips folding.
This makes a lot more sense.
See https://github.com/rust-lang/rust/blob/2627e9f3012a97d3136b3e11bf6bd0853c38a534/compiler/rustc_errors/src/emitter.rs#L1878C17-L1939C18

In contrast to rustc, I made the amount of context a variable to make
the intent clearer and to open the door to it being configurable.
src/renderer/display_list.rs Fixed Show fixed Hide fixed
src/renderer/display_list.rs Fixed Show fixed Hide fixed
src/renderer/display_list.rs Fixed Show fixed Hide fixed
src/renderer/display_list.rs Fixed Show fixed Hide fixed
Copy link
Member

@Muscraft Muscraft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Muscraft Muscraft merged commit f8642f4 into rust-lang:master Mar 21, 2024
13 checks passed
@epage epage deleted the fold-rustc branch March 21, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants