matchdelete may fail

fixes github issue #15
This commit is contained in:
依云 2014-06-20 13:32:38 +08:00
parent e0bdb79615
commit 3bd0d5e8c1

View file

@ -328,7 +328,11 @@ function! s:ClearMatches() "{{{1
return
endif
for i in values(w:colormatches)
call matchdelete(i)
try
call matchdelete(i)
catch /.*/
" matches have been cleared in other ways, e.g. user has called clearmatches()
endtry
endfor
unlet w:colormatches
endfunction