Skip to content

Commit 565b2b0

Browse files
committed
use matchstr() over substitute() where applicable
1 parent a3379d0 commit 565b2b0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

after/syntax/css.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function! s:FGforBG(bg)
1818
endfunction
1919

2020
function! s:SetMatcher(clr,pat)
21-
let group = 'cssColor'.substitute(a:clr,'^#','','')
21+
let group = 'cssColor'.matchstr(a:clr,'^#\zs.*')
2222
redir => s:currentmatch
2323
silent! exe 'syn list' group
2424
redir END
@@ -102,7 +102,7 @@ function! s:Rgb2xterm(color)
102102
endfunction
103103

104104
function! s:SetNamedColor(clr,name)
105-
let group = 'cssColor'.substitute(a:clr,'^#','','')
105+
let group = 'cssColor'.matchstr(a:clr,'^#\zs.*')
106106
exe 'syn keyword' group a:name 'contained'
107107
exe 'syn cluster cssColors add='.group
108108
if has('gui_running')

0 commit comments

Comments
 (0)