mirror of
https://github.com/bronson/vim-trailing-whitespace.git
synced 2025-11-08 03:23:53 -05:00
Merge pull request #30 from nusendra/fix/TerminalOpen-event-not-found-in-nvim
fix: add dynamic TerminalOpen for both vim and nvim
This commit is contained in:
@@ -16,7 +16,8 @@ endfunction
|
||||
" Highlight EOL whitespace, http://vim.wikia.com/wiki/Highlight_unwanted_spaces
|
||||
highlight default ExtraWhitespace ctermbg=darkred guibg=darkred
|
||||
autocmd ColorScheme * highlight default ExtraWhitespace ctermbg=darkred guibg=darkred
|
||||
autocmd BufRead,BufNew,FileType,TerminalOpen * if ShouldMatchWhitespace() | match ExtraWhitespace /\\\@<![\u3000[:space:]]\+$/ | else | match ExtraWhitespace /^^/ | endif
|
||||
let term_open_event = (has('nvim') ? 'TermOpen' : 'TerminalOpen')
|
||||
exe 'autocmd BufRead,BufNew,FileType,' term_open_event '* if ShouldMatchWhitespace() | match ExtraWhitespace /\\\@<![\u3000[:space:]]\+$/ | else | match ExtraWhitespace /^^/ | endif'
|
||||
|
||||
" The above flashes annoyingly while typing, be calmer in insert mode
|
||||
autocmd InsertLeave * if ShouldMatchWhitespace() | match ExtraWhitespace /\\\@<![\u3000[:space:]]\+$/ | endif
|
||||
|
||||
Reference in New Issue
Block a user