Skip to content

Commit

Permalink
Add syntax and highlight for unmatched files and folders
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagofumo committed May 27, 2020
1 parent 43852ce commit 6225131
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions after/syntax/nerdtree.vim
Original file line number Diff line number Diff line change
Expand Up @@ -558,3 +558,29 @@ for [key, val] in items(g:NERDTreePatternMatchHighlightColor)
endif
endfor

let icon_closed = g:WebDevIconsUnicodeDecorateFolderNodesDefaultSymbol
let icon_open = g:DevIconsDefaultFolderOpenSymbol
let identifier = 'WebDevIconsDefaultFolderSymbol'
exec 'silent syn match '.identifier.' "\c['.icon_closed.']\ze.*/" containedin=NERDTreeFlags'
exec 'silent syn match '.identifier.' "\c['.icon_open.']\ze.*/" containedin=NERDTreeFlags'
if !exists('g:WebDevIconsDisableDefaultFolderSymbolColorFromNERDTreeDir')
exec 'hi def link '.identifier.' NERDTreeDir'
else
" exec 'hi def link '.identifier.' NERDTreeFlags'
let NERDTreeFlagsTrans = synIDattr(synIDtrans(hlID('NERDTreeFlags')), 'name')
exec 'hi def link '.identifier.' '.NERDTreeFlagsTrans
endif
if exists('g:WebDevIconsDefaultFolderSymbolColor')
call s:X(identifier, g:WebDevIconsDefaultFolderSymbolColor, '', '')
endif

let icon = g:WebDevIconsUnicodeDecorateFileNodesDefaultSymbol
let identifier = 'WebDevIconsDefaultFileSymbol '
exec 'silent syn match '.identifier.' "\v\c\zs['.icon.']\ze.*" containedin=NERDTreeFlags'
if !exists('g:WebDevIconsDisableDefaultFileSymbolColorFromNERDTreeFile')
exec 'hi def link '.identifier.' NERDTreeFile'
exec 'hi! def link NERDTreeFlags NERDTreeFile'
endif
if exists('g:WebDevIconsDefaultFileSymbolColor')
call s:X(identifier, g:WebDevIconsDefaultFileSymbolColor, '', '')
endif

0 comments on commit 6225131

Please sign in to comment.