@@ -65,6 +65,7 @@ call s:initVariable("g:NERDTreeShowFiles", 1)
6565call s: initVariable (" g:NERDTreeShowHidden" , 0 )
6666call s: initVariable (" g:NERDTreeShowLineNumbers" , 0 )
6767call s: initVariable (" g:NERDTreeSortDirs" , 1 )
68+ call s: initVariable (" g:NERDTreeDirArrows" , 0 )
6869
6970if ! exists (" g:NERDTreeSortOrder" )
7071 let g: NERDTreeSortOrder = [' \/$' , ' *' , ' \.swp$' , ' \.bak$' , ' \~$' ]
@@ -147,7 +148,7 @@ endif
147148let s: NERDTreeBufName = ' NERD_tree_'
148149
149150let s: tree_wid = 2
150- let s: tree_markup_reg = ' ^[ `|▾▸ ]*[\-+~ ]*'
151+ let s: tree_markup_reg = ' ^[ `|]*[\-+~▾▸ ]*'
151152let s: tree_up_dir_line = ' .. (up a dir)'
152153
153154" the number to add to the nerd tree buffer name to make the buf name unique
@@ -1313,20 +1314,50 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
13131314 " get all the leading spaces and vertical tree parts for this line
13141315 if a: depth > 1
13151316 for j in a: vertMap [0 :-2 ]
1316- let treeParts = treeParts . ' '
1317+ if g: NERDTreeDirArrows
1318+ let treeParts = treeParts . ' '
1319+ else
1320+ if j == # 1
1321+ let treeParts = treeParts . ' | '
1322+ else
1323+ let treeParts = treeParts . ' '
1324+ endif
1325+ endif
13171326 endfor
13181327 endif
13191328
1329+ " get the last vertical tree part for this line which will be different
1330+ " if this node is the last child of its parent
1331+ if ! g: NERDTreeDirArrows
1332+ if a: isLastChild
1333+ let treeParts = treeParts . ' `'
1334+ else
1335+ let treeParts = treeParts . ' |'
1336+ endif
1337+ endif
1338+
13201339 " smack the appropriate dir/file symbol on the line before the file/dir
13211340 " name itself
13221341 if self .path .isDirectory
13231342 if self .isOpen
1324- let treeParts = treeParts . ' ▾ '
1343+ if g: NERDTreeDirArrows
1344+ let treeParts = treeParts . ' ▾ '
1345+ else
1346+ let treeParts = treeParts . ' ~'
1347+ endif
13251348 else
1326- let treeParts = treeParts . ' ▸ '
1349+ if g: NERDTreeDirArrows
1350+ let treeParts = treeParts . ' ▸ '
1351+ else
1352+ let treeParts = treeParts . ' +'
1353+ endif
13271354 endif
13281355 else
1329- let treeParts = treeParts . ' '
1356+ if g: NERDTreeDirArrows
1357+ let treeParts = treeParts . ' '
1358+ else
1359+ let treeParts = treeParts . ' -'
1360+ endif
13301361 endif
13311362 let line = treeParts . self .displayString ()
13321363
@@ -3054,10 +3085,12 @@ function! s:getPath(ln)
30543085 return b: NERDTreeRoot .path
30553086 endif
30563087
3057- " in case called from outside the tree
3058- " if line !~# '^ *[|`▸▾ ]' || line =~# '^$'
3059- " return {}
3060- " endif
3088+ if ! g: NERDTreeDirArrows
3089+ " in case called from outside the tree
3090+ if line !~# ' ^ *[|`▸▾ ]' || line = ~# ' ^$'
3091+ return {}
3092+ endif
3093+ endif
30613094
30623095 if line == # s: tree_up_dir_line
30633096 return b: NERDTreeRoot .path .getParent ()
0 commit comments