EXSyst / php-twig

This is a conversion of Anomareh / PHP-Twig.tmbundle for atom
https://atom.io/packages/language-twig
4 stars 4 forks source link

Toggle Line Comments #4

Closed carlcs closed 9 years ago

carlcs commented 9 years ago

It would be great if there was support for Twig comments with the "CMD + /" toggle line comments function, so that:

{% set comment = 'Not working yet!' %}

changes to:

{# set comment = 'Not working yet!' #}
GuilhemN commented 9 years ago

It's a great idea, but it would be like :

{#% set comment = 'Not working yet!' %#}

Because it's more flexible :)

I will search to do that ;)

GuilhemN commented 9 years ago

It may be

{#{% set comment = 'Not working yet!' %}#}

because i don't know how to do ... If somebody knows how it works he can do a pull request :)

GuilhemN commented 9 years ago

For the moment it works on the {% %}

carlcs commented 9 years ago

This is really strange. Now that I see your answer and your latest commits I tried to comment out some Twig code before updating and noticed that it already works with 1.4??! Not sure what happened, maybe one of the latest Atom updates (was still on 0.145 when I posted the issue). Anyways, thanks for taking a look at the relevant regexes and improving that functionality, Ener-Getick!!

carlcs commented 9 years ago

Close if you want, or leave open until you find a solution without double open and close tags.

GuilhemN commented 9 years ago

It works sometimes but not always ... I will continue to search :) But I don't have many times for the moment ...

thamas commented 8 years ago

It would be nice to be able to choose between Twig comment and HTML comment when using HTML Twig grammar. It is always HTML comment currently.

GuilhemN commented 8 years ago

@thamas not sure that's possible, why would you need that ?

carlcs commented 8 years ago

@Ener-Getick I recently made the switch to the Craft-Twig package, which has some nice Craft CMS specific snippets. https://github.com/fruitstudios/Craft-Twig

Not sure if you improved the commenting behavior since I last checked, but it works perfectly using Craft-Twig. Though it might be interesting for you! Cheers