VSCodeVim / VSCodeVim/Vim

HTML tag selection doesn't work expected

Open
#7,385 3 comments 31 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug

Selecting inside HTML tag chooses portion of the tag itself if the tag is split over multiple lines.

To Reproduce

  1. Have a hello.html file with contents (including line breaks):

        <p>
      foo</p>
    
  2. Move cursor to f character. Use vim key combination vit (visual select inside tag)

  3. Observe that visual highlighted text includes the > portion of <p>.

Expected behavior

> portion of the opening tag <p> should not be selected.
Original Vim does not select that character.

Screenshots

image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: v1.21.10
  • VSCode version: 1.63.2
  • OS: macOS Monterey

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the described hello.html contents and the Vim vit command, then compare the selection with original Vim. Trace the HTML tag-selection behavior from that reproduction and verify that the closing > of the opening tag is excluded when the tag spans lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.