Use small triangles for directories and get rid of ascii bars
This commit is contained in:
parent
2504666a72
commit
eac32148a4
@ -147,7 +147,7 @@ endif
|
||||
let s:NERDTreeBufName = 'NERD_tree_'
|
||||
|
||||
let s:tree_wid = 2
|
||||
let s:tree_markup_reg = '^[ `|]*[\-+~]'
|
||||
let s:tree_markup_reg = '^[ `|▾▸]*[\-+~ ]*'
|
||||
let s:tree_up_dir_line = '.. (up a dir)'
|
||||
|
||||
"the number to add to the nerd tree buffer name to make the buf name unique
|
||||
@ -1313,33 +1313,20 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
|
||||
"get all the leading spaces and vertical tree parts for this line
|
||||
if a:depth > 1
|
||||
for j in a:vertMap[0:-2]
|
||||
if j ==# 1
|
||||
let treeParts = treeParts . '| '
|
||||
else
|
||||
let treeParts = treeParts . ' '
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
"get the last vertical tree part for this line which will be different
|
||||
"if this node is the last child of its parent
|
||||
if a:isLastChild
|
||||
let treeParts = treeParts . '`'
|
||||
else
|
||||
let treeParts = treeParts . '|'
|
||||
endif
|
||||
|
||||
|
||||
"smack the appropriate dir/file symbol on the line before the file/dir
|
||||
"name itself
|
||||
if self.path.isDirectory
|
||||
if self.isOpen
|
||||
let treeParts = treeParts . '~'
|
||||
let treeParts = treeParts . '▾ '
|
||||
else
|
||||
let treeParts = treeParts . '+'
|
||||
let treeParts = treeParts . '▸ '
|
||||
endif
|
||||
else
|
||||
let treeParts = treeParts . '-'
|
||||
let treeParts = treeParts . ''
|
||||
endif
|
||||
let line = treeParts . self.displayString()
|
||||
|
||||
@ -3068,9 +3055,9 @@ function! s:getPath(ln)
|
||||
endif
|
||||
|
||||
" in case called from outside the tree
|
||||
if line !~# '^ *[|`]' || line =~# '^$'
|
||||
return {}
|
||||
endif
|
||||
" if line !~# '^ *[|`▸▾ ]' || line =~# '^$'
|
||||
" return {}
|
||||
" endif
|
||||
|
||||
if line ==# s:tree_up_dir_line
|
||||
return b:NERDTreeRoot.path.getParent()
|
||||
|
Loading…
Reference in New Issue
Block a user