thecodechef / nunjucks-extended

A Better Nunjucks Syntax Highlighter for Sublime Text
MIT License
16 stars 2 forks source link

Adds Nunjucks formatted comment regardless #4

Open djmtype opened 6 years ago

djmtype commented 6 years ago

This package applies Nunjucks-formatted comments to .html and .php file types.

For example, Toggle Comments applied via default keyboard binding or command prints comments as {# … #} instead of <!-- … -->. Some its own snippets can override the default snippets. In this case, the Toggle Comments.

Regardless, Nunjucks-formatted comments should only be printed according to the appropriate file type.

So, how can this problem be fixed if we want nunjucks-formatted comments in .njk files, but also want html-styled comments in .html and *.php files?

harberg commented 5 years ago

I am having the same problem.

alsolovyev commented 4 years ago

You can solve this problem by changing the scope value in the comment settings file(nunjucks-extended/Preferences/Comments.tmPreferences):

<key>name</key>
<string>Comments</string>
<key>scope</key>
<string>source.njk</string> 
<key>settings</key>

To do this:

  1. Extract "Comments.tmPreferences" file from "nunjucks-extended" with Package​Resource​Viewer
  2. Change the seventh line as above

or manually:

  1. Create directories "nunjucks-extended/Preferences/" in the packages directory(Sublime menu -> Preferences ->Browse Packages)
  2. Download "Comments.tmPreferences" from github
  3. Change the seventh line as above
  4. Save the file to a previously created folder(Sublime Text 3/Packages/nunjucks-extended/Preferences/)