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
558 stars 18 forks source link

toggle_comment doesn't work inside object literal #179

Closed YuriGor closed 5 years ago

YuriGor commented 5 years ago

Try to ctrl+/ on title or subtitle line

const mdf = {
  title: "While your other man was out there,",
  subtitle: "cheatin' and lyin', steppin' all over you"
};

Note that native JS syntax works here but incorrectly: It comments fine, but leaves extra space character before the text, so please don't repeat its mistake.

StreetStrider commented 5 years ago

Bothers me too.

StreetStrider commented 5 years ago

To be precise, the issue is not in object literals. I've detected that commenting out stops working when cursor is inside string literlal. fyi @borela

borela commented 5 years ago

I sent a patch on the master branch that should fix the empty space artifact, I'll check the string literal issue.

borela commented 5 years ago

@StreetStrider & @YuriGor I sent a patch on the master branch which should fix both problems, the issue was the way it detected string literals, please check if there are no side effects.

YuriGor commented 5 years ago

@borela works perfectly for me, thank you @StreetStrider I am not sure how to reproduce your case

borela commented 5 years ago

@YuriGor The patch also included a fix for that case too.

borela commented 5 years ago

Released the fix https://github.com/borela/naomi/releases/tag/v4.2.7

StreetStrider commented 5 years ago

Confirming it's working ok.