Skip to content

Commit 867de91

Browse files
committed
Make indentation of file nodes more intuitive
1 parent eac3214 commit 867de91

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

plugin/NERD_tree.vim

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ function! s:TreeFileNode._renderToString(depth, drawText, vertMap, isLastChild)
13261326
let treeParts = treeParts . ''
13271327
endif
13281328
else
1329-
let treeParts = treeParts . ''
1329+
let treeParts = treeParts . ' '
13301330
endif
13311331
let line = treeParts . self.displayString()
13321332

@@ -3112,7 +3112,13 @@ function! s:getTreeWinNum()
31123112
endfunction
31133113
"FUNCTION: s:indentLevelFor(line) {{{2
31143114
function! s:indentLevelFor(line)
3115-
return match(a:line, '[^ \-+~`|]') / s:tree_wid
3115+
let level = match(a:line, '[^ \-+~▸▾`|]') / s:tree_wid
3116+
" check if line includes arrows
3117+
if match(a:line, '[▸▾]') > -1
3118+
" decrement level as arrow uses 3 ascii chars
3119+
let level = level - 1
3120+
endif
3121+
return level
31163122
endfunction
31173123
"FUNCTION: s:isTreeOpen() {{{2
31183124
function! s:isTreeOpen()

0 commit comments

Comments
 (0)