-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Highlighting locations in lines with unicode on rich terminals #11917
Comments
(see #11918 for dumb terminals) |
cc @Julow: reply here if you want to get this issue assigned to you :-) |
I can have a look at both issues. |
(No replying, no assigning, that's a limitation of the github interface.) |
The https://redprl.org/asai/asai/design.html#unicode-art The points made there are reminiscent of the discussion happening here. (cc @favonia for cross-information, although there is nothing specific we are asking you to do here; of course help working on these topics is always welcome) |
I'm glad that our notes help. :-) Your proposal in this GitHub issue is basically the same as our choice, for exactly the same reasons. I see there are some complaints about tabs in #9116 and #9118. In case it's relevant, for control characters and other "bad" characters, we either expand them to spaces or replace them with Some further information: I'm planning to rewrite our built-in terminal renderer to abandon |
I was never convinced by the tags approach which is totally uncompositional. I think that the ability for formatters to store arbitrary key-value data is the right way of solving the problem of adapting formatting functions to the output context (e.g. tty vs text, unicode art vs ASCII art etc.). Note that nowadays that we have In |
In #11899, @hhugo points out that our current approach of highlighting locations using
^^^^
on the line below is fragile in presence of unicode characters with a non-obvious display width.The discussion of #11899 clarifies that it seems unrealistic to be able to compute the "right" width at which to place the
^
on the line below (especially within the compiler distribution with a minimal library footprint).For rich terminals, we propose instead to stick to location-highlighting formats that are "on-line" in the sense of being overlayed on the line: text font, weight or color, underlining, etc.
Proposal: use underlining to highlight the location in the quoted string.
This is what we use in the toplevel, but not (currently) in the "rich" error reporting format in batch mode.
The text was updated successfully, but these errors were encountered: