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
Improve single line label rendering #241
Conversation
78ca5d4
to
05ad84a
Compare
dfe8330
to
2ab3679
Compare
7df8674
to
49672eb
Compare
Ok, this should be ready for review! |
codespan-reporting/tests/snapshots/term__unicode_spans__rich_no_color.snap
Show resolved
Hide resolved
│ ^ | ||
│ │ | ||
│ Unexpected '{' | ||
│ Expected '(' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should ultimately address one of the main complaints described in #231 by @tnowacki. cc. diem/diem#3447
Note that this still does not cover the case where single line labels overlap multiline labels. Multiline labels will still be rendered below single line labels, eg.
I still think this is a much needed improvement, however! |
49672eb
to
664d27e
Compare
This makes the rendering of carets smarter when there are multiple labels on the same line. Instead of this: ``` ┌─ one_line.rs:3:5 │ 3 │ v.push(v.pop().unwrap()); │ - first borrow later used by call │ ---- first mutable borrow occurs here │ ^ second mutable borrow occurs here │ ``` ...we now render the following: ``` ┌─ one_line.rs:3:5 │ 3 │ v.push(v.pop().unwrap()); │ - ---- ^ second mutable borrow occurs here │ │ │ │ │ first mutable borrow occurs here │ first borrow later used by call │ ```
a9ed983
to
1580d08
Compare
This makes the rendering of carets smarter when there are multiple labels on the same line. Instead of this:
...we now render the following:
Resolves #211.