Added global variables for changing default arrows

This commit is contained in:
Igor Tatarintsev
2015-09-11 23:44:06 +06:00
parent bcf3de4fdf
commit 188bd92658
6 changed files with 22 additions and 11 deletions

View File

@@ -383,13 +383,13 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
if self.path.isDirectory
if self.isOpen
if g:NERDTreeDirArrows
let treeParts = treeParts . ' '
let treeParts = treeParts . g:NERDTreeDirArrowCollapsable . ' '
else
let treeParts = treeParts . '~'
endif
else
if g:NERDTreeDirArrows
let treeParts = treeParts . ' '
let treeParts = treeParts . g:NERDTreeDirArrowExpandable . ' '
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 !~# '^ *[|`▸▾ ]' || line =~# '^$'
if line !~# '^ *[|`'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.' ]' || 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, '[^ \-+~▸▾`|]') / s:UI.IndentWid()
let level = match(a:line, '[^ \-+~'.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'`|]') / s:UI.IndentWid()
" check if line includes arrows
if match(a:line, '[▸▾]') > -1
if match(a:line, '['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.]') > -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 '^\([▾▸] \| \+[▾▸] \| \+\)'
return '^\(['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'] \| \+['.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsable.'] \| \+\)'
endif
return '^[ `|]*[\-+~]'