vscode-markdownlint
vscode-markdownlint copied to clipboard
fixing MD034 moves cursor into wrong/awkward position
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

after

expected

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

after

expected

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.
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.