admin管理员组文章数量:1355522
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...
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...
Share Improve this question edited Jul 25, 2011 at 2:48 dmonopoly asked Nov 18, 2010 at 1:48 dmonopolydmonopoly 3,3315 gold badges36 silver badges53 bronze badges 1- Or Visual Web Developer from Microsoft, it's free as long as you register. Great editor. – Blake Commented Nov 18, 2010 at 1:58
3 Answers
Reset to default 8You can configure Notepad++ to recognize an .erb (.html.erb or .js.erb) file and associate it with a given language (html).
- In the menu bar, go to Settings > Style Configurator...
- In the list labelled "Language:", scroll down to HTML. Click on it
- Beneath the lists for Language and Style, there should appear two fields: Default ext and User ext. Enter 'erb' in the User ext field.
- Click Save & Close
Now when you open a file with the .erb extension (incl. .js.erb), Notepad++ will automatically apply syntax highlighting for HTML.
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. :)
Check the post here:
- http://www.thekua./atwork/2009/07/file-associations-in-notepad/
It allows you to change the associations.
本文标签:
版权声明:本文标题:Notepad++ is recognizing my html.erb files as javascript files! It's messing up my syntax highlighting! - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743936390a2564758.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论