philsinatra / HTML-Nest-Comments

This is a Sublime Text 2 and 3 plugin allowing you to quickly comment out blocks of HTML code that already contain HTML comments.
MIT License
17 stars 2 forks source link

Limit Scope to HTML Files Only in Sublime Text 3 #4

Open lunacodes opened 8 years ago

lunacodes commented 8 years ago

HTML-Nest-Comments currently affects files of any syntax, instead of just html/php. This is an issue, since Sublime Text 3 does not handle nested comments in CSS properly. Currently this plugin prevents implementing a similar function for nested comments in CSS.

This is due to the else statement on line 16 in HTMLNestComments.py, which simply needs to be changed to elif

I'd be happy to submit a pull request with the change.

philsinatra commented 8 years ago

Would it be more helpful to add conditions for CSS files to this functionality, or do what you're proposing and just limit the functionality to only HTML based comments?

lunacodes commented 8 years ago

I think the first is more helpful - it frees up the Ctrl+Shift+/ for use in other plugins. But Also - implementing this in CSS is useful too!! it would be great to see both

(Side Note: Sublime Text currently executes multi-line comments using the single line comment tag (example: in C every line will have // instead of having a block with /* */). I'm planning to write a plugin that will allow for using multiline comments syntax in any language via Ctrl+Shift+/ & either way, it would be great to see the functionality for NestHTMLComments be HTML/CSS specific :smile_cat:)

lunacodes commented 8 years ago

(Edited the above post to fix some inaccuracies)

philsinatra commented 8 years ago

I hesitate since there hasn't been any complaints or requests for such a change. I'd be more interested in a simple way to detect the current open file syntax and only apply the comment effect if the file type meets a certain criteria (html, php etc.).

ctf0 commented 8 years ago

maybe this https://github.com/jfcherng/Sublime-AutoSetSyntax/blob/master/AutoSetSyntax.py could help ?

lunacodes commented 8 years ago

@philsinatra - that sounds great, and I think you've got the right gyst/separation of concerns!