Skip to content

Commit

Permalink
Handle new buffer types: popups (#129)
Browse files Browse the repository at this point in the history
* Disable in floating windows by default

* Fix highlighting disabled on popup close

Close #128
  • Loading branch information
Cimbali authored Mar 24, 2020
1 parent 4afbd45 commit 8cf4b21
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugin/better-whitespace.vim
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ endif
function! s:ShouldHighlight()
" Guess from the filetype if a) not locally decided, b) globally enabled, c) there is enough information
if !exists('b:better_whitespace_enabled') && g:better_whitespace_enabled == 1 && !(empty(&buftype) && empty(&filetype))
let b:better_whitespace_enabled = &buftype != 'nofile' && index(g:better_whitespace_filetypes_blacklist, &ft) == -1
let b:better_whitespace_enabled = &buftype != 'nofile' && &buftype != 'popup' && index(g:better_whitespace_filetypes_blacklist, &ft) == -1
endif
return get(b:, 'better_whitespace_enabled', g:better_whitespace_enabled)
endfunction
Expand Down Expand Up @@ -341,7 +341,7 @@ function! <SID>SetupAutoCommands()

if g:current_line_whitespace_disabled_soft == 0
" Using syntax: clear whitespace highlighting when leaving buffer
autocmd BufWinLeave * call <SID>ClearHighlighting()
autocmd BufWinLeave * if expand("<afile>") == expand("%") | call <SID>ClearHighlighting() | endif

" Do not highlight whitespace on current line in insert mode
autocmd CursorMovedI * call <SID>HighlightEOLWhitespaceExceptCurrentLine()
Expand Down

0 comments on commit 8cf4b21

Please sign in to comment.