Skip to content

Commit 1b0f83d

Browse files
committed
(faux-)namespace our window variable
1 parent fcf5829 commit 1b0f83d

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

autoload/css_color.vim

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,8 @@ function! s:create_syn_match()
178178
endfunction
179179

180180
function! s:clear_matches()
181-
if exists('w:color_match_id')
182-
call filter(w:color_match_id, 'matchdelete(v:val)')
183-
unlet w:color_match_id
184-
endif
181+
call map(get(w:, 'css_color_match_id', []), 'matchdelete(v:val)')
182+
unlet! w:css_color_match_id
185183
endfunction
186184

187185
function! s:create_matches()
@@ -191,14 +189,13 @@ function! s:create_matches()
191189
let group = ''
192190
let groupstart = 0
193191
let endcol = col('$')
194-
let w:color_match_id = []
192+
let w:css_color_match_id = []
195193
for col in range( 1, endcol )
196194
let nextgroup = col < endcol ? synIDattr( synID( lnr, col, 1 ), 'name' ) : ''
197195
if group == nextgroup | continue | endif
198196
if group =~ '^BG\x\{6}$'
199197
let regex = '\%'.lnr.'l\%'.groupstart.'c'.repeat( '.', col - groupstart )
200-
let match = matchadd( group, regex, -1 )
201-
let w:color_match_id += [ match ]
198+
let w:css_color_match_id += [ matchadd( group, regex, -1 ) ]
202199
endif
203200
let group = nextgroup
204201
let groupstart = col

0 commit comments

Comments
 (0)