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

Created on 18 Dec 2019  路  4Comments  路  Source: VSCodeVim/Vim

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):

  • Extension (VsCodeVim) version: 1.12.2
  • VSCode version: 1.41.0
  • OS: macOS Mojave 10.14.6

Most helpful comment

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.

All 4 comments

I also experienced this on the following Environment:

  • VsCodeVim version: 1.12.2

  • VSCode version: 1.41.0-1

  • Arch Linux

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.

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

liamdawson picture liamdawson  路  3Comments

Jimmy-Z picture Jimmy-Z  路  3Comments

st-schneider picture st-schneider  路  3Comments

edwintorok picture edwintorok  路  3Comments

cckowin picture cckowin  路  3Comments