Skip to content

Commit

Permalink
fix: use exists() to avoid unnecessary silent
Browse files Browse the repository at this point in the history
refer: #2852
  • Loading branch information
lervag committed Dec 20, 2023
1 parent e7ce03e commit 6179414
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions autoload/vimtex/matchparen.vim
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ endfunction

" }}}1
function! s:matchparen.clear() abort dict " {{{1
silent! call matchdelete(w:vimtex_match_id1)
silent! call matchdelete(w:vimtex_match_id2)
unlet! w:vimtex_match_id1
unlet! w:vimtex_match_id2
if exists('w:vimtex_match_id1')
call matchdelete(w:vimtex_match_id1)
call matchdelete(w:vimtex_match_id2)
unlet! w:vimtex_match_id1
unlet! w:vimtex_match_id2
endif
endfunction
function! s:matchparen.highlight() abort dict " {{{1
call self.clear()
Expand Down

0 comments on commit 6179414

Please sign in to comment.