Vscode-neovim: VS Code's built in emmet "Wrap with abbreviation" doesn't wrap with tag correctly

Created on 22 Dec 2019  路  6Comments  路  Source: asvetliakov/vscode-neovim

First of all thank you Alexey for making this extension. Compared to VSCodeVim it's just bliss. So fast! And supports original vim extensions!

What is wrong:
Entering visual line, selecting some tags then wrapping the selection with tag using Emmet outputs some broken tags.

Repro gif
GIF animation showing how emmet does not wrap tags correctly when using vscode-vim

The weird thing is that it only breaks sometimes. I had to redo the operation from the gif 3 times until it broke. Here's it working for some reason:
GIF animation showing how emmet for some reaason now wraps tags correctly using vscode-neovim

I later disabled all vscode extensions (enabled vscode-neovim obviously) and neovim plugins and checked again - emmet stilll did not wrap correctly.

VSCode info:
Version: 1.41.0
[...]
Date: 2019-12-11T18:32:17.711Z
OS: Linux x64 5.0.0-37-generic - ubuntu 18.04

vscode-neovim version: 0.0.42

Neovim info:
Version: 0.4.3
Installed from AppImage

The workaround right now is to just:

  1. install vim-surround (vim extension) inside neovim
  2. select the text you want to wrap
  3. type S<div>

I'm writing this issue so it's known. I'm not sure if the goal of this project is to integrate vscode and neovim in such a way that most features are compatible OR should everything just be delegated to neovim (such as tag wrapping)

bug

All 6 comments

Oh, I see. This is because visual mode doesn't produce real vscode selections yet
https://github.com/asvetliakov/vscode-neovim/compare/new-cursor-logic#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR3

@3nuc
No, it's in separate branch and not merged yet 馃槂 (Even after merging it will convert visual range to vscode selection range when calling command palette from visual mode, so it shouldn't be a problem)

as for re: issue - will look soon

I think i found the problem - currently visual modes may produce 2 cursors (to workaround some differences with vscode selections). This why emmet breaks. If you put cursor to the end of the line while in visual mode it works fine.

New branch you've mentioned should fix the problem also, i think, because it will spawn single line selection when invoking command, not multi-cursor.

Notice the position of the "virtual" cursor on last line
gif

Works in master, the fix will be in v0.0.43

Yup. Works great now. Thanks a lot for taking the time to fix this one :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iansinnott picture iansinnott  路  4Comments

RAbraham picture RAbraham  路  4Comments

DrakeXiang picture DrakeXiang  路  3Comments

DrakeXiang picture DrakeXiang  路  4Comments

kkorus picture kkorus  路  4Comments