dmonopoly
dmonopoly

Reputation: 3331

Notepad++ is recognizing my html.erb files as javascript files! It's messing up my syntax highlighting!

This is really annoying...it really is messing up my syntax highlighting... I think it suddenly happened after I deleted one of my javascript_include_tag statements and saved...suddenly the highlighting changed.

This all happened around the time I created my first js.erb file...

Oh yeah: It was working before!!! I have "erb" already added as a file association/extension to html files...but for some reason, html.erb files are suddenly getting interpreted as javascript files! like, in the bottom left, it says what type of file you are viewing, and when I have an html.erb file open it says "javascript file" which is absurd...it used to say html erb...

Upvotes: 2

Views: 4363

Answers (3)

dmonopoly
dmonopoly

Reputation: 3331

I figured out the problem myself. Since Rails 3 uses this new js.erb file, at one point, I went to the style configurator and added "erb" as an extension option under "Javascript." I had already done this for html so html.erb is recognized as html, so apparently notepad++ has this bug in it b/c once I added "erb" to Javascript all html.erb began getting recognized as JS files. Removing that "erb" to Javascript in the style configurator fixed the problem. :)

Upvotes: 2

Jellicle
Jellicle

Reputation: 30216

You can configure Notepad++ to recognize an .erb (.html.erb or .js.erb) file and associate it with a given language (html).

  1. In the menu bar, go to Settings > Style Configurator...
  2. In the list labelled "Language:", scroll down to HTML. Click on it
  3. Beneath the lists for Language and Style, there should appear two fields: Default ext and User ext. Enter 'erb' in the User ext field.
  4. Click Save & Close

Now when you open a file with the .erb extension (incl. .js.erb), Notepad++ will automatically apply syntax highlighting for HTML.

Upvotes: 8

icyrock.com
icyrock.com

Reputation: 28608

Check the post here:

It allows you to change the associations.

Upvotes: 0

Related Questions