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

Error output should use monospace font #2933

Open
lrhn opened this issue Apr 23, 2024 · 3 comments · Fixed by #2980
Open

Error output should use monospace font #2933

lrhn opened this issue Apr 23, 2024 · 3 comments · Fixed by #2980

Comments

@lrhn
Copy link
Member

lrhn commented Apr 23, 2024

The error output from the compiler is displayed in a proportional font.
Since it contains lines with "^"s that point into the prior line, based on character count, the position of that ^ is not correct when viewed using a proportional font, and important in information is lost or misleading..
Compare:

main.dart:20:20: Error: Property 'y' cannot be accessed on '({int x, int y})?' because it is potentially null.
Try accessing using ?. instead.
    print((a!.x, a.y, n3: 0)); // ERR
                   ^

with

main.dart:20:20: Error: Property 'y' cannot be accessed on '({int x, int y})?' because it is potentially null.
Try accessing using ?. instead.
    print((a!.x, a.y, n3: 0)); // ERR
                   ^

In the latter, it's possible to see that the ^ is on the y.
In the former, probably depending on font, OS and scaling, it seems like the ^ points nearer to the , after x, which is not where the error is.

To reproduce, use fx:

final ({int x, int y})? a = null;
void main() {
  print((a!.x, a.y, n3: 0)); // ERR
}

and try to run it. The compiler error output (bottom right) is shown in proportional font, and shows an ^ pointing near the x, not at the y as it should.

@lrhn lrhn changed the title Error output should use monospace fon,t Error output should use monospace font Apr 23, 2024
@Karelaking
Copy link

can you explain this properly. and add some images and examples

@lrhn
Copy link
Member Author

lrhn commented Jun 3, 2024

Have expanded on the description, and added an example that reproduces the issue.

The examples already show the problem of displaying output intended for fixed-width fonts in a proportional font.

@lrhn
Copy link
Member Author

lrhn commented Aug 30, 2024

Hasn't landed yet. Font is still proportional. (Linux desktop.)

@lrhn lrhn reopened this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants