If arrows are empty strings, don't print their trailing spaces.

This commit is contained in:
Phil Runninger 2020-02-03 01:58:00 -05:00
parent 8c48845d11
commit 26333ceeab
2 changed files with 5 additions and 12 deletions

View File

@ -104,16 +104,11 @@ function! s:TreeDirNode.displayString()
endfor
" Select the appropriate open/closed status indicator symbol.
if l:cascade[-1].isOpen
let l:symbol = g:NERDTreeDirArrowCollapsible
else
let l:symbol = g:NERDTreeDirArrowExpandable
endif
let l:padding = g:NERDTreeDirArrowExpandable == '' ? '' : ' '
let l:symbol = (l:cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable ) . l:padding
let l:flags = l:cascade[-1].path.flagSet.renderToString()
let l:result = l:symbol . ' ' . l:flags . l:label
return l:result
return l:symbol . l:flags . l:label
endfunction
" FUNCTION: TreeDirNode.findNode(path) {{{1

View File

@ -321,13 +321,11 @@ function! s:TreeFileNode._renderToString(depth, drawText)
if a:drawText ==# 1
let treeParts = repeat(' ', a:depth - 1)
if !self.path.isDirectory
let treeParts = treeParts . ' '
if !self.path.isDirectory && g:NERDTreeDirArrowExpandable != ''
let treeParts .= ' '
endif
let line = treeParts . self.displayString()
let output = output . line . "\n"
endif