VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.97k stars 1.32k forks source link

Dual cursor appears on tag match and causes error when switching to Visual Line Mode in HTML file #4402

Open mikenap opened 4 years ago

mikenap commented 4 years ago

Describe the bug When hovering over the beginning HTML tag of a pair, in Normal Mode, a second cursor appears on the closing tag. When switching to Visual Line Mode, with SHIFT + V, VS Code shows the message "ModeHandler: unexpected selection mode. selectionMode=4" and does not switch to Visual Line Mode.

To Reproduce Create an HTML tag pair (i.e opening and closing div tags). In Normal Mode, place the cursor on either of the tag pair. A second cursor will appear on the opposite tag. Try switching to Visual Line Mode with SHIFT + V, the message "ModeHandler: unexpected selection mode. selectionMode=4" will appear and will not switch to Visual Line Mode and highlight the line.

Expected behavior When placing the cursor on a beginning or closing HTML tag element, a second (or dual cursor) should not appear on the opening and closing HTML tags, and switching to Visual Line Mode with SHIFT + V should switch the editor to Visual Line Mode.

Environment (please complete the following information):

icemanx7 commented 4 years ago

I also experienced this on the following Environment:

cvaldev commented 4 years ago

This seems similar to #4378.

The extra cursor you are seeing is not being caused by the Vim extension. vscode added this feature in the November update: https://code.visualstudio.com/updates/v1_41#_html-mirror-cursor. You need to set html.mirrorCursorOnMatchingTag to false in your settings to have the behaviour you were expecting.

I was able to reproduce the error, on any file type, by just using VisualLine mode while multiple cursors are active.

armoucar commented 4 years ago

You need to set html.mirrorCursorOnMatchingTag to false in your settings to have the behaviour you were expecting.

That fixes the problem. But now I can't use % command for matching tag pairs :(

> Emmet: Go to matching Pair works though.

Svtter commented 4 years ago

This seems similar to #4378.

The extra cursor you are seeing is not being caused by the Vim extension. vscode added this feature in the November update: https://code.visualstudio.com/updates/v1_41#_html-mirror-cursor. You need to set html.mirrorCursorOnMatchingTag to false in your settings to have the behaviour you were expecting.

I was able to reproduce the error, on any file type, by just using VisualLine mode while multiple cursors are active.

It is editor.RenameOnType now.