vscode-markdownlint icon indicating copy to clipboard operation
vscode-markdownlint copied to clipboard

fixing MD034 moves cursor into wrong/awkward position

Open zzzz465 opened this issue 3 years ago • 1 comments

fixing MD034 using fix on save set cursor to a awkward position.

1. when the cursor is positioned newline after a link

the cursor moves into a link and makes a selection from it to the next newline

before

image

after

image

expected

image

2. when the cursor is positioned on the link

the cursor doesn't move to the end, which makes it awkward to edit forward.

before

image

after

image

expected

image

zzzz465 avatar Sep 03 '22 04:09 zzzz465

Sounds very similar to: https://github.com/DavidAnson/vscode-markdownlint/issues/159

I’ll have a look, but I may not be able to coax the right behavior out of VS Code.

DavidAnson avatar Sep 03 '22 05:09 DavidAnson

This works correctly for me on VS Code 1.74.2 (Mac) with markdownlint 0.48.1. Specifically, with "editor.formatOnSave": true active, your scenario 1 behaves as you expect with the cursor remaining on the line after the link and your scenario two leaves the cursor between the "o" and "m". (Note that scenario 2 with the cursor after the "m" results in the cursor being after the ">", but this makes sense as it stays at the end of the line. Putting the cursor anywhere in ".com" keeps it where it as as you want.

DavidAnson avatar Jan 11 '23 05:01 DavidAnson