mattn / emmet-vim

emmet for vim: http://emmet.io/
http://mattn.github.io/emmet-vim
MIT License
6.41k stars 411 forks source link

Autocomplete will override existed unicode characters #438

Open ikey4u opened 5 years ago

ikey4u commented 5 years ago

To reproduce do the followings: 1: Open an html file 2: In the beginning of an empty line, input 地图 a_ 3: in the position _ , press ctrl+y, then the unicode chars 地图 will dissappear And the message given by vim is emmet#expandAddr(0,"")

I use macos 10.13 + vim 8.1 + latest emmet-vim plugin

Update: I check the commits and have the following result: dcf8f6efd8323f11e93aa1fb1349c8a1dcaa1e15 works well but since 3fb134b503eeb3fc6cf91a7fd9716a7fb7dbeed6 emmet-vim fails!

mattrossman commented 4 years ago

This is an issue for writing ES6 tagged template strings, e.g. for lit-html or Preact's HTM.

If I wrap an abbreviation with backticks to place it in a template string, e.g.

`div`

Then after expansion, emmet-vim will delete the backticks:

<div></div>

Furthermore if I have a tag on the template string:

html`div`

Then emmet-vim will delete the backticks and turn the tag function into a separate HTML tag:

<html></html>
<div></div>

However, it SHOULD produce this:

html`<div></div>`