diff --git a/plugin/better-whitespace.vim b/plugin/better-whitespace.vim index 3cd4e6a..076c2e7 100644 --- a/plugin/better-whitespace.vim +++ b/plugin/better-whitespace.vim @@ -345,7 +345,7 @@ endfunction function! SetupAutoCommands() augroup better_whitespace " Reset all auto commands in group - autocmd! + autocmd! * if ShouldHighlight() if s:better_whitespace_initialized == 0 @@ -354,19 +354,19 @@ function! SetupAutoCommands() " Highlight extraneous whitespace at the end of lines, but not the current line in insert mode. call HighlightEOLWhitespace() - autocmd CursorMovedI,InsertEnter * call HighlightEOLWhitespaceExceptCurrentLine() - autocmd InsertLeave,BufReadPost * call HighlightEOLWhitespace() + autocmd CursorMovedI,InsertEnter call HighlightEOLWhitespaceExceptCurrentLine() + autocmd InsertLeave,BufReadPost call HighlightEOLWhitespace() if g:current_line_whitespace_disabled_soft == 0 " Using syntax: clear whitespace highlighting when leaving buffer - autocmd BufWinLeave * if expand("") == expand("%") | call ClearHighlighting() | endif + autocmd BufWinLeave if expand("") == expand("%") | call ClearHighlighting() | endif " Do not highlight whitespace on current line in insert mode - autocmd CursorMovedI * call HighlightEOLWhitespaceExceptCurrentLine() + autocmd CursorMovedI call HighlightEOLWhitespaceExceptCurrentLine() " Do not highlight whitespace on current line in normal mode? if g:current_line_whitespace_disabled_hard == 1 - autocmd CursorMoved * call HighlightEOLWhitespaceExceptCurrentLine() + autocmd CursorMoved call HighlightEOLWhitespaceExceptCurrentLine() endif endif @@ -377,7 +377,7 @@ function! SetupAutoCommands() " Strip whitespace on save if enabled. if ShouldStripWhitespaceOnSave() - autocmd BufWritePre * call StripWhitespaceOnSave(v:cmdbang) + autocmd BufWritePre call StripWhitespaceOnSave(v:cmdbang) endif augroup END