VSCodeVim / VSCodeVim/Vim

Surround with HTML tags with attributes puts attributes in closing tag

Open
#7,157 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
It used to be that surrounding (e.g.) xyz with <a href="…"> would correctly generate <a href="…">xyz</a>, however this functionality seems to have been broken when surround started to use the top bar instead of the status bar (sorry, I don’t know what these are really called in VS Code terms).

To Reproduce

  1. insert the text xyz
  2. type viwS<a href="">, then Enter
  3. the editor reads <a href="">xyz</a href="">

Expected behavior

  1. insert the text xyz
  2. type viwS<a href="">, then Enter
  3. the editor reads <a href="">xyz</a>

Environment (please complete the following information):

Version: 1.61.0 (user setup)
Commit: ee8c7def80afc00dd6e593ef12f37756d8f504ea
Date: 2021-10-07T18:13:09.652Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.22471

VSCodeVim version: 1.21.8.

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 issue in VS Code with the viwS<a href=""> sequence described in the report and compare the generated opening and closing tags. Trace the surround behavior associated with the top bar, then verify that attributes remain only in the opening tag and that the expected output is produced.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.