Improve the code style in a "Path" method

No functional changes here.  Only style improvements were made.
This commit is contained in:
Jason Franklin 2018-01-06 08:41:55 -05:00
parent f4df038366
commit e6a116a9cd

View File

@ -14,21 +14,23 @@ lockvar s:NERDTreeSortStarIndex
let s:Path = {} let s:Path = {}
let g:NERDTreePath = s:Path let g:NERDTreePath = s:Path
" FUNCTION: Path.AbsolutePathFor(str) {{{1 " FUNCTION: Path.AbsolutePathFor(pathStr) {{{1
function! s:Path.AbsolutePathFor(str) function! s:Path.AbsolutePathFor(pathStr)
let prependCWD = 0 let l:prependWorkingDir = 0
if nerdtree#runningWindows() if nerdtree#runningWindows()
let prependCWD = a:str !~# '^.:\(\\\|\/\)' && a:str !~# '^\(\\\\\|\/\/\)' let l:prependWorkingDir = a:pathStr !~# '^.:\(\\\|\/\)' && a:pathStr !~# '^\(\\\\\|\/\/\)'
else else
let prependCWD = a:str !~# '^/' let l:prependWorkingDir = a:pathStr !~# '^/'
endif endif
let toReturn = a:str let l:result = a:pathStr
if prependCWD
let toReturn = getcwd() . s:Path.Slash() . a:str if l:prependWorkingDir
let l:result = getcwd() . s:Path.Slash() . a:pathStr
endif endif
return toReturn return l:result
endfunction endfunction
" FUNCTION: Path.bookmarkNames() {{{1 " FUNCTION: Path.bookmarkNames() {{{1