borela / naomi

Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files.
Other
557 stars 20 forks source link

Backtick inside JSX prop={} doesn't auto-pair #253

Open markalfred opened 4 years ago

markalfred commented 4 years ago

If you try to add a backtick-wrapped string inside of a JSX prop, it won't pair the backtick. Not a big deal, but when you go to add the second backtick, it tries to auto-pair that one, leaving you with three backticks. 😭 And if you delete that second one, it deletes two of them, leaving you in your original sorry state of a single backtick without a friend in the world. 😭 😭

backtick

It seems to be because it views the internals of {} as source.jsx until it contains anything, at which point it becomes source.js. Make special note of the position of the cursor in the following screenshots:

image

image

image

I think that in all three of these cases, the selector should be considered source.js rather than source.jsx. But I'm not positive.

Thank you for your time, and the excellent package!