endif
call Resize_Columns(Extra_Columns("list", "iainlist", " == 2"), 1)
+ call Extra_Whitespace_Match()
endfun "}}}2
" Cycle between hex and decimal display of toolbar stuff.
call Show_StatusLine()
endfun "{{{2
+" To be overridden later if applicable.
+fun! Extra_Whitespace_Match() "{{{2
+ " NOP.
+endfun "}}}2
+
" Swap hex/decimal statusline with \x.
call Mapping("x", ":call Cycle_HexStatusLine()<CR>:<CR>")
" Change statusline verbosity with \v.
let g:NERDSpaceDelims=1
endif "}}}1
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Handle options only available in Vim 7.2 and above.
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+if version >= "702" "{{{1
+if has("autocmd")
+ " http://vim.wikia.com/wiki/Highlight_unwanted_spaces
+ augroup WhitespaceMatch
+ autocmd!
+ au Display BufWinEnter * call Extra_Whitespace_Match()
+ au Display Syntax * call Extra_Whitespace_Match()
+ au Display BufWinLeave * call clearmatches()
+ augroup END
+
+ fun! Extra_Whitespace_Match() "{{{2
+ " \s\+ <whitespace>
+ " $ <before end of line>
+ " \@<! <unless preceded by>
+ " \%# <cursor position, ie when typing>
+ let l:pattern = '\s\+\%#\@<!$'
+ " Don't match single space in first column of diff.
+ if &ft =~# '^diff$\|git'
+ " \@! <unless also matching>
+ " \(^\s$\) <a single whitespace>
+ let l:pattern = '\(^\s$\)\@!' . l:pattern
+ endif
+
+ let l:hl = 'ctermfg=red guifg=red'
+ if ! &list
+ " Underline if we aren't using listchars.
+ let l:hl = l:hl . ' cterm=underline gui=underline'
+ endif
+ highlight clear ExtraWhitespace
+ exe "highlight ExtraWhitespace " . l:hl
+ if exists('w:whitespace_match_number')
+ try
+ call matchdelete(w:whitespace_match_number)
+ catch
+ endtry
+ call matchadd('ExtraWhitespace', l:pattern, 10, w:whitespace_match_number)
+ else
+ let w:whitespace_match_number = matchadd('ExtraWhitespace', l:pattern)
+ endif
+ endfun "}}}2
+
+ call Extra_Whitespace_Match()
+endif
+
+endif "}}}1
+
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Handle options only available in Vim 7.3 and above.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""