Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Extra tag when applying tag in Vim surround commands

Open mladenuzelac opened this issue 5 years ago • 9 comments

Describe the bug When I select and apply HTML tag it adds an extra closing tag to the opening tag or it doesn't close opening tag properly

To Reproduce Steps to reproduce the behavior:

Case 1

  1. Select some text visually or the whole line by yss, press S and apply a tag
  2. outcome is `selected text

Case 2:

  1. Select some text visually or line by yss and enter the tag but instead of closing tag press Enter
  2. outcome is: `<tagSelected text

Expected behavior It should normally surround the selected text with a HTML tag

Screenshots

image

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.17.1
  • VSCode version: 1.50.1
  • OS: Windows 10 build 20246.re_release.201024-2009

Additional context Add any other context about the problem here.

mladenuzelac avatar Nov 02 '20 20:11 mladenuzelac

Having same issue here. I think VsCode is auto completing the opening tag at the same time the vim extension surround command is wrapping the text, creating the duplicate closing tag. Haven't figured out how to make it not do that without losing tag autocomplete altogether.... Current workaround is just to hit 'u' to undo the extra autocompleted tag.

zenlex avatar Jun 07 '22 19:06 zenlex

Same problem here.

Asttear avatar Sep 25 '22 14:09 Asttear

I know it is not a solution to this problem but it is how I escaped it. I started using VSC with Neovim extension and installed vim-surround plugin for Neovim and it works inside VSC

mladenuzelac avatar Sep 25 '22 15:09 mladenuzelac

Is there any solution yet? I have the same issue...

Poulbi avatar Jan 01 '23 13:01 Poulbi

Seriously. Still no solution?

trobriander avatar Feb 22 '23 03:02 trobriander

My solution was to change to neovim completely. Much faster, much better.

Poulbi avatar Feb 22 '23 14:02 Poulbi

Thanks for the tip. And yes indeed, nice performance improvement!

trobriander avatar Feb 23 '23 06:02 trobriander

I had the same problem, but I found it can be solved through executing u operation to make it back to normal

siuyutpang avatar Apr 20 '23 14:04 siuyutpang

I had the same problem, but I found it can be solved through executing u operation to make it back to normal

Thanks for the quick fix!

Nishal3 avatar Apr 01 '24 17:04 Nishal3