sjbach / lusty

LustyExplorer / LustyJuggler for Vim
http://www.vim.org/scripts/script.php?script_id=1890
257 stars 30 forks source link

Call to clearmatches #26

Closed jnz closed 13 years ago

jnz commented 13 years ago

I have added a match to my vimrc to display trailing whitespace characters in red (see appendix). This has the side-effect that in the Lusty-Explorer buffer some trailing whitespace/tab characters are also highlighted in red. My current solution is to add the following call to lusty-explorer.vim/display.rb:

    VIM::evaluate 'clearmatches()'

Update: forgot src/

Appendix: highlight ExtraWhitespace ctermbg=red guibg=red autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red match ExtraWhitespace /\s+$/ autocmd BufWinEnter * match ExtraWhitespace /\s+$/ autocmd InsertEnter * match ExtraWhitespace /\s+\%#\@<!$/ autocmd InsertLeave * match ExtraWhitespace /\s+$/ autocmd BufWinLeave * call clearmatches()

sjbach commented 13 years ago

Merged, thanks! I made one small modification, as apparently clearmatches() only exists in Vim 7.2+, and I suppose it makes sense to maintain compatibility a little further back.