question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cursor is at start of line with lines_longer_than_80_chars

See original GitHub issue

Issue Type: Bug

When an issue is found with the linter rule lines_longer_than_80_chars enabled, the cursor is placed at the start of the offending line.

As the next most likely action is to move the cursor to character 80 (or nearby at least), it would save keystrokes if the cursor were automatically placed there when the error is found.

To reproduce this, enable the lines_longer_than_80_chars linter rule in your analysis_options.yaml file, and make yourself a really long comment line:

/// The handle used by all calls to [getInt], [setInt], [getBool], and [setBool].

Press F8 to go to the next problem in files, and your cursor should be placed at the start of your long line, rather at the 80th character.

Extension version: 3.21.1 VS Code version: Code 1.55.0 (c185983a683d14c396952dd432459097bc7f757f, 2021-03-30T16:01:55.261Z) OS version: Windows_NT x64 10.0.19042

System Info
Item Value
CPUs AMD Ryzen 7 3700U with Radeon Vega Mobile Gfx (8 x 2296)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 13.95GB (5.69GB free)
Process Argv –crash-reporter-id 18f46c6e-60cd-45d3-a2f1-fe06aa8b9f5a
Screen Reader yes
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspyt653:30270858
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstry914:30276682
pythonvsdeb440:30248342
pythonvsded773:30248341
pythonvspyt875:30259475
pythontb:30283811
openwslfolder:30282073
vspre833:30267464
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30276952
pythondataviewer:30285071

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisnorman7commented, Apr 12, 2021

Legend, thank you so much.

Take care,

Chris Norman

On Sun, 11 Apr 2021 at 19:51, Danny Tuppeny @.***> wrote:

Great! Updating the lint and not needing an option definitely sounds better. I filed a PR with what I think the change is here:

dart-lang/linter#2578 https://github.com/dart-lang/linter/pull/2578

After trying it out, I’m not concerned about the reduced squiggle length - it’s pretty noticeable even for a single character, and it’s actually a lot less noisy than before so I prefer it.

[image: Screenshot showing long lines of code with only the characters past 80 underlined] https://user-images.githubusercontent.com/1078012/114316755-cf94be80-9afc-11eb-914c-c9418f900660.png

I’ll close this issue as a dupe of the linter issue https://github.com/dart-lang/linter/issues/2570 since there’s nothing to do here in the VS Code extension - if the fix ships in the SDK, you’ll get it automatically when updating to a future SDK version.

If you find any other places you think can/should be improved (for screen readers or otherwise), please do file additional issues. Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dart-Code/Dart-Code/issues/3263#issuecomment-817354741, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBUZ2IKV5ADSVABPMHLAQLTIHVTPANCNFSM42SO22NA .

0reactions
DanTupcommented, Apr 11, 2021

Great! Updating the lint and not needing an option definitely sounds better. I filed a PR with what I think the change is here:

https://github.com/dart-lang/linter/pull/2578

After trying it out, I’m not concerned about the reduced squiggle length - it’s pretty noticeable even for a single character, and it’s actually a lot less noisy than before so I prefer it.

Screenshot showing long lines of code with only the characters past 80 underlined

I’ll close this issue as a dupe of the linter issue since there’s nothing to do here in the VS Code extension - if the fix ships in the SDK, you’ll get it automatically when updating to a future SDK version.

If you find any other places you think can/should be improved (for screen readers or otherwise), please do file additional issues. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is 80 characters the 'standard' limit for code width?
Lines that are 80 characters long may cause wrapping when the file is dumped to an 80 column terminal unless the terminal is...
Read more >
Is there a valid reason for enforcing a maximum width of 80 ...
No it is not. If you write a longer than 80 chars line, you probably already have a problem in expression complexity or...
Read more >
VI - finding lines longer than 80 characters
In VI, is there an easy way to find all lines whose length is greater than 80 characters? I realize tabs are a...
Read more >
Are 80 Characters Per Line Still Reasonable In 2020?
The 80 character line length is optimal for English word lengths, because that gives you an optimal number of words per line to...
Read more >
Format only long lines - Vim Tips Wiki - Fandom
In Vim, you may want to format long lines, that is, wrap long lines so the longest is, say, 80 characters. The standard...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found