Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit 0944b92

Browse files
Jonathan del Strotherragaskar
authored andcommitted
Add SASS syntax highlighting for asset pipeline helper methods
1 parent ad7bb29 commit 0944b92

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

autoload/rails.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,9 @@ function! s:BufSyntax()
37123712
set isk+=$
37133713
exe "syn keyword javascriptRailsFunction ".s:javascript_functions
37143714

3715+
elseif &syntax == "scss" || &syntax == "sass"
3716+
syn match sassFunction "\<\%(\%(asset\|image\|font\|video\|audio\|javascript\|stylesheet\)-\%(url\|path\)\)\>(\@=" contained
3717+
syn match sassFunction "\<\asset-data-url\>(\@=" contained
37153718
endif
37163719
endif
37173720
call s:HiDefaults()
@@ -4549,7 +4552,7 @@ augroup railsPluginAuto
45494552
autocmd BufWritePost */tasks/**.rake call rails#cache_clear("rake_tasks")
45504553
autocmd BufWritePost */generators/** call rails#cache_clear("generators")
45514554
autocmd FileType * if exists("b:rails_root") | call s:BufSettings() | endif
4552-
autocmd Syntax ruby,eruby,yaml,haml,javascript,coffee,railslog if exists("b:rails_root") | call s:BufSyntax() | endif
4555+
autocmd Syntax ruby,eruby,yaml,haml,javascript,coffee,railslog,sass,scss if exists("b:rails_root") | call s:BufSyntax() | endif
45534556
autocmd QuickFixCmdPre *make* call s:push_chdir()
45544557
autocmd QuickFixCmdPost *make* call s:pop_command()
45554558
augroup END

0 commit comments

Comments
 (0)