Skip to content

Commit

Permalink
add syntax highlighting for new erb/builder rails templates
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Jan 8, 2008
1 parent d09a84c commit 5cabe28
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/uv_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ def Uv.syntaxes

def Uv.syntax_for_file file_name
init_syntaxes unless @syntax_index
@syntax_index[File.extname(file_name)[1..-1]]
ext = File.extname(file_name)[1..-1]
# if the extension isn't in there, look for the 'full' extension,
# like '.html.erb'
if @syntax_index[ext].nil? && file_name =~ /[^\.]+\.(.*$)/
ext = $1 if ext != $1
end
@syntax_index[ext]
end
end
3 changes: 3 additions & 0 deletions syntax/html_rails.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
name: HTML (Rails)
fileTypes:
- rhtml
- html.erb
- xml.erb
- js.erb
scopeName: text.html.ruby
uuid: 45D7E1FC-7D0B-4105-A1A2-3D10BB555A5C
foldingStartMarker: |-
Expand Down
1 change: 1 addition & 0 deletions syntax/ruby_on_rails.syntax
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name: Ruby on Rails
fileTypes:
- rxml
- builder
scopeName: source.ruby.rails
uuid: 54D6E91E-8F31-11D9-90C5-0011242E4184
foldingStartMarker: "(?x)^\n\
Expand Down

0 comments on commit 5cabe28

Please sign in to comment.