Simplify and make similar statements more similarer

This commit is contained in:
Phil Runninger
2020-02-03 09:30:08 -05:00
parent 450abd1820
commit c3d7c141bb
2 changed files with 3 additions and 5 deletions

View File

@@ -104,8 +104,8 @@ function! s:TreeDirNode.displayString()
endfor endfor
" Select the appropriate open/closed status indicator symbol. " Select the appropriate open/closed status indicator symbol.
let l:padding = g:NERDTreeDirArrowExpandable ==# '' ? '' : ' ' let l:symbol = (l:cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable )
let l:symbol = (l:cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable ) . l:padding let l:symbol .= (g:NERDTreeDirArrowExpandable ==# '' ? '' : ' ')
let l:flags = l:cascade[-1].path.flagSet.renderToString() let l:flags = l:cascade[-1].path.flagSet.renderToString()
return l:symbol . l:flags . l:label return l:symbol . l:flags . l:label

View File

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