Added global variables for changing default arrows

g:NERDTreeDirArrowExpandable
g:NERDTreeDirArrowCollapsable
This commit is contained in:
Igor Tatarintsev
2015-09-11 23:52:37 +06:00
parent 188bd92658
commit dc29ec2db3
6 changed files with 10 additions and 10 deletions

View File

@@ -383,7 +383,7 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
if self.path.isDirectory
if self.isOpen
if g:NERDTreeDirArrows
let treeParts = treeParts . g:NERDTreeDirArrowCollapsable . ' '
let treeParts = treeParts . g:NERDTreeDirArrowCollapsible . ' '
else
let treeParts = treeParts . '~'
endif

View File

@@ -154,7 +154,7 @@ function! s:UI.getPath(ln)
if !g:NERDTreeDirArrows
" in case called from outside the tree
if line !~# '^ *[|`'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.' ]' || line =~# '^$'
if line !~# '^ *[|`'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.' ]' || line =~# '^$'
return {}
endif
endif
@@ -261,9 +261,9 @@ endfunction
"FUNCTION: s:UI._indentLevelFor(line) {{{1
function! s:UI._indentLevelFor(line)
let level = match(a:line, '[^ \-+~'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'`|]') / s:UI.IndentWid()
let level = match(a:line, '[^ \-+~'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'`|]') / s:UI.IndentWid()
" check if line includes arrows
if match(a:line, '['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.]') > -1
if match(a:line, '['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']') > -1
" decrement level as arrow uses 3 ascii chars
let level = level - 1
endif
@@ -278,7 +278,7 @@ endfunction
"FUNCTION: s:UI.MarkupReg() {{{1
function! s:UI.MarkupReg()
if g:NERDTreeDirArrows
return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'] \| \+\)'
return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.'] \| \+\)'
endif
return '^[ `|]*[\-+~]'