From a2b06bbac35ef2e6478486b85b6153f04658dcc1 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 26 Nov 2015 00:24:44 +0000 Subject: [PATCH] remove references to NERDTreeDirArrows Closes #515 --- README.markdown | 1 - lib/nerdtree/ui.vim | 13 +------------ syntax/nerdtree.vim | 44 ++++++++++---------------------------------- 3 files changed, 11 insertions(+), 47 deletions(-) diff --git a/README.markdown b/README.markdown index 66e8896..5debfa9 100644 --- a/README.markdown +++ b/README.markdown @@ -116,6 +116,5 @@ See here: https://github.com/scrooloose/nerdtree/issues/433#issuecomment-9259069 Use these variables in your vimrc. Note that below are default arrow symbols - let g:NERDTreeDirArrows = 1 let g:NERDTreeDirArrowExpandable = '▸' let g:NERDTreeDirArrowCollapsible = '▾' diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index ed23526..1ad4469 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -158,13 +158,6 @@ function! s:UI.getPath(ln) return self.nerdtree.root.path endif - if !g:NERDTreeDirArrows - " in case called from outside the tree - if line !~# '^ *[|`'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.' ]' || line =~# '^$' - return {} - endif - endif - if line ==# s:UI.UpDirLine() return self.nerdtree.root.path.getParent() endif @@ -311,11 +304,7 @@ endfunction "FUNCTION: s:UI.MarkupReg() {{{1 function! s:UI.MarkupReg() - if g:NERDTreeDirArrows - return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+\)' - endif - - return '^[ `|]*[\-+~]' + return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+\)' endfunction "FUNCTION: s:UI._renderBookmarks {{{1 diff --git a/syntax/nerdtree.vim b/syntax/nerdtree.vim index 846cf49..8a4e424 100644 --- a/syntax/nerdtree.vim +++ b/syntax/nerdtree.vim @@ -22,43 +22,19 @@ syn match NERDTreeLinkDir #.*/ ->#me=e-3 containedin=NERDTreeDir "highlighing for directory nodes and file nodes syn match NERDTreeDirSlash #/# containedin=NERDTreeDir -if g:NERDTreeDirArrows - exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile' - exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile' +exec 'syn match NERDTreeClosable #'.escape(g:NERDTreeDirArrowCollapsible, '~').'# containedin=NERDTreeDir,NERDTreeFile' +exec 'syn match NERDTreeOpenable #'.escape(g:NERDTreeDirArrowExpandable, '~').'# containedin=NERDTreeDir,NERDTreeFile' - let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~') - exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#' - syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark - exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile' +let s:dirArrows = escape(g:NERDTreeDirArrowCollapsible, '~').escape(g:NERDTreeDirArrowExpandable, '~') +exec 'syn match NERDTreeDir #[^'.s:dirArrows.' ].*/#' +syn match NERDTreeExecFile #^ .*\*\($\| \)# contains=NERDTreeRO,NERDTreeBookmark +exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# contains=NERDTreeLink,NERDTreeRO,NERDTreeBookmark,NERDTreeExecFile' - "highlighting for readonly files - syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile +"highlighting for readonly files +syn match NERDTreeRO # *\zs.*\ze \[RO\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile - syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile - syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir -else - "highlighting for the ~/+ symbols for the directory nodes - syn match NERDTreeClosable #\~\<# - syn match NERDTreeClosable #\~\.# - syn match NERDTreeOpenable #+\<# - syn match NERDTreeOpenable #+\.#he=e-1 - - "highlighting for the tree structural parts - syn match NERDTreePart #|# - syn match NERDTreePart #`# - syn match NERDTreePartFile #[|`]-#hs=s+1 contains=NERDTreePart - - syn match NERDTreeDir #[^-| `].*/# contains=NERDTreeLink,NERDTreeOpenable,NERDTreeClosable - syn match NERDTreeExecFile #[|` ].*\*\($\| \)# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark - syn match NERDTreeFile #|-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile - syn match NERDTreeFile #`-.*# contains=NERDTreeLink,NERDTreePart,NERDTreePartFile,NERDTreeBookmark,NERDTreeExecFile - - "highlighting for readonly files - syn match NERDTreeRO #|-.*\[RO\]#he=e-5 contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreePart,NERDTreePartFile - - syn match NERDTreeFlags #-\[.\]# containedin=NERDTreeFile,NERDTreePartFile - syn match NERDTreeFlags #[+~]\zs\[.\]# containedin=NERDTreeDir -endif +syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile +syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir syn match NERDTreeCWD #^[