Skip to content

Commit

Permalink
add less and css support
Browse files Browse the repository at this point in the history
  • Loading branch information
shmargum committed Apr 18, 2020
1 parent b70c898 commit 3b16cb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion autoload/sass-colors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@
CSS_COLORS_INVERSE[v] = k
end

prefix_regex = /\/(?:stylesheets|sass|scss|style|styles)\//
prefix_regex = /\/(?:stylesheets|sass|scss|less|style|styles)\//
if ENV['VIM_SASS_COLORS_BASE_FOLDERS']
prefix_regex = /\/(?:#{ENV['VIM_SASS_COLORS_BASE_FOLDERS'].split(',').join('|')})\//
end
Expand Down
4 changes: 2 additions & 2 deletions autoload/vim_sass_colors.vim
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function! vim_sass_colors#run()

" only add $variable name to group
if l:cname != 'placeholder'
let l:new_match = matchadd(l:group, '\v\$'.l:cname.'([^a-zA-Z0-9-_])@=')
let l:new_match2 = matchadd(l:group, '\v\$'.l:cname.'($)@=')
let l:new_match = matchadd(l:group, '\v[$@]'.l:cname.'([^a-zA-Z0-9-_])@=')
let l:new_match2 = matchadd(l:group, '\v[$@]'.l:cname.'($)@=')
call add(w:vim_sass_color_matches, l:new_match)
call add(w:vim_sass_color_matches, l:new_match2)
endif
Expand Down
5 changes: 5 additions & 0 deletions ftplugin/css.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if exists("w:did_vim_sass_colors")
finish
endif
let w:did_vim_sass_colors = 1
call vim_sass_colors#init()
5 changes: 5 additions & 0 deletions ftplugin/less.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if exists("w:did_vim_sass_colors")
finish
endif
let w:did_vim_sass_colors = 1
call vim_sass_colors#init()

0 comments on commit 3b16cb3

Please sign in to comment.