Skip to content

Commit ac889fc

Browse files
committed
Do not call clearmatches(), but only clear our group
1 parent fb5b0b8 commit ac889fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugin/better-whitespace.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function! <SID>SetupAutoCommands()
171171
autocmd!
172172

173173
if index(g:better_whitespace_filetypes_blacklist, &ft) >= 0
174-
silent! call clearmatches()
174+
match ExtraWhitespace ''
175175
return
176176
endif
177177

@@ -195,7 +195,7 @@ function! <SID>SetupAutoCommands()
195195
" Highlight all whitespace when exiting insert mode
196196
autocmd InsertLeave,BufReadPost * match ExtraWhitespace /\s\+$/
197197
" Clear whitespace highlighting when leaving buffer
198-
autocmd BufWinLeave * call clearmatches()
198+
autocmd BufWinLeave * match ExtraWhitespace ''
199199
else
200200
" Highlight extraneous whitespace at the end of lines, but not the
201201
" current line

0 commit comments

Comments
 (0)