Vscode: [html] Mirror Cursor does not work with double-click selection

Created on 3 Dec 2019  路  5Comments  路  Source: microsoft/vscode

Testing #85973

<html>
    <foo class='fff'>

    </foo>
</html>
  • double click on foo to select the full word
  • type a new name. Does not rename the closing foo
editor-synced-region feature-request html

Most helpful comment

Selecting the whole tag is the typical interaction I do when I want to change/rename a tag. Select the full tag with doubleclick, enter the new tag name, overwriting the old name. So It would be great if that also works with auto rename.

Expanding a selection is a different issue. I rarely do that.
IMO if the selection is just convering the tag: create a multicursor selection on the closing tag.
As soon as it spans more, do not create/drop multicursor selection on the closing tag.
I think that's very intuitive and matches the behaviour of the empty cursor case.

All 5 comments

Since this is achievable with both F2 and click end of foo and option + delete (both are shorter operations).

I stayed away from handling selections since imagine one goes from left to right on line one:

<|div id="foo">
</|div> 

When the selection advances pass div, how should the bottom selection behave?

  • If you stop bottom selection as top grows, it's unintuitive since when you grow from d to div, bottom selection grew as well
  • Just drop bottom selection seems weird

Not doing this also simplifies the logic a lot.

Selecting the whole tag is the typical interaction I do when I want to change/rename a tag. Select the full tag with doubleclick, enter the new tag name, overwriting the old name. So It would be great if that also works with auto rename.

Expanding a selection is a different issue. I rarely do that.
IMO if the selection is just convering the tag: create a multicursor selection on the closing tag.
As soon as it spans more, do not create/drop multicursor selection on the closing tag.
I think that's very intuitive and matches the behaviour of the empty cursor case.

Please reconsider or, at least, reopen as feature request so others can add their opinions too.

Neither double-click or manual selection of a tag name works, which for me are more natural behaviors than positioning the cursor with the arrow keys.

I've been waiting for the ability to change tag names for a while, so this is a leap in the right direction. Just need to nail down the various selection methods. 馃憤

This works now (when enabling the feature with "editor.renameOnType": true

Was this page helpful?
0 / 5 - 0 ratings