emmet-vim icon indicating copy to clipboard operation
emmet-vim copied to clipboard

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

Open leafOfTree opened this issue 7 years ago • 5 comments

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 avatar Jul 18 '18 10:07 leafOfTree

After updating emmet, change imap return value from

return emmet#expandAbbr(0, "")

to

return emmet#expandAbbr(1, "")

it works. Thanks again!

leafOfTree avatar Jul 19 '18 02:07 leafOfTree

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

Now

render: (text) => div

produces

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

leafOfTree avatar Jul 20 '18 07:07 leafOfTree

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.

systemmonkey42 avatar Jan 08 '19 11:01 systemmonkey42

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

mattn avatar Jan 09 '19 00:01 mattn

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

systemmonkey42 avatar Jan 09 '19 03:01 systemmonkey42