mattn / emmet-vim

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

`>` in arrow function `=>` leads unexpected behaviour #428

Open leafOfTree opened 6 years ago

leafOfTree commented 6 years ago

Hello, when I use emmet in jsx file,

    render: (text) => div|

produces

    render: <text></text>
<div></div>

instead of

    render: (text) => <div></div>

> in => seems to cause expanding word before =>. Is there anyway to distinguish > in a => bfrom > in a>b?

Thanks.

leafOfTree commented 6 years ago

After updating emmet, change imap return value from

return emmet#expandAbbr(0, "")

to

return emmet#expandAbbr(1, "")

it works. Thanks again!

leafOfTree commented 6 years ago

=> issue still exists for emmet#expandAbbr(0, "")

Now

render: (text) => div

produces

render: (text) <div></div>
systemmonkey42 commented 5 years ago

Any movement on this? When combined with JSX, the emmet#expandAbbr() hotkey will make quite a mess.

Is there a javascipt lang file? It appears that javascript is treated like HTML. We might need a javascript or JSX specific lang file with context sensitive token detection.

mattn commented 5 years ago

Sorry, please show me what is wrong and your expected.

systemmonkey42 commented 5 years ago

It appears to be '(' rather than '=>' in this case.

<Route path="/" exact strict render={() => ( h1{Welcome Home}

Pressing the expandAbbr() hotkey at this point results in

Route path="/" exact strict render={() => <h1>Welcome Home</h1>

rather than..

<Route path="/" exact strict render={() => ( <h1>Welcome Home</h1>

Thanks