VSCodeVim / VSCodeVim/Vim

Surround with html tag, indentation is off

Open
#2,531 0 comments 4 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

BUG REPORT

What happened:

For example we have:

    <div>
        <div class="navigation">
            <div class='container'>
                <a href="/" class="logo" title="Home" style="position: absolute;">
                    <img src="/images/logo.png">
                    <div class="beta-ribbon">
                        <div class="beta-ribbon-content">BETA</div>
                    </div>
                </a>
        </div>
   </div>

I select with V

                <a href="/" class="logo" title="Home" style="position: absolute;">
                    <img src="/images/logo.png">
                    <div class="beta-ribbon">
                        <div class="beta-ribbon-content">BETA</div>
                    </div>
                </a>

and type S<div>

I got

    <div>
        <div class="navigation">
            <div class='container'>
<div>
                <a href="/" class="logo" title="Home" style="position: absolute;">
                    <img src="/images/logo.png">
                    <div class="beta-ribbon">
                        <div class="beta-ribbon-content">BETA</div>
                    </div>
                </a>
</div>
        </div>
    </div>

What did you expect to happen:

I tried the same thing in native vim and I got:

    <div>
        <div class="navigation">
            <div class='container'>
                <div>
                    <a href="/" class="logo" title="Home" style="position: absolute;">
                        <img src="/images/logo.png">
                        <div class="beta-ribbon">
                            <div class="beta-ribbon-content">BETA</div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>

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

Reproduce the reported Visual Studio Code Vim visual-selection workflow with an HTML snippet and compare its indentation with native Vim. Trace the surround-with-tag behavior and verify that the inserted tag and selected lines are indented one level deeper, matching the expected example.

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
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.