mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-26 10:14:20 +08:00
Improve the code style in a "Path" method
No functional changes here. Only style improvements were made.
This commit is contained in:
parent
f4df038366
commit
e6a116a9cd
|
@ -14,21 +14,23 @@ lockvar s:NERDTreeSortStarIndex
|
|||
let s:Path = {}
|
||||
let g:NERDTreePath = s:Path
|
||||
|
||||
" FUNCTION: Path.AbsolutePathFor(str) {{{1
|
||||
function! s:Path.AbsolutePathFor(str)
|
||||
let prependCWD = 0
|
||||
" FUNCTION: Path.AbsolutePathFor(pathStr) {{{1
|
||||
function! s:Path.AbsolutePathFor(pathStr)
|
||||
let l:prependWorkingDir = 0
|
||||
|
||||
if nerdtree#runningWindows()
|
||||
let prependCWD = a:str !~# '^.:\(\\\|\/\)' && a:str !~# '^\(\\\\\|\/\/\)'
|
||||
let l:prependWorkingDir = a:pathStr !~# '^.:\(\\\|\/\)' && a:pathStr !~# '^\(\\\\\|\/\/\)'
|
||||
else
|
||||
let prependCWD = a:str !~# '^/'
|
||||
let l:prependWorkingDir = a:pathStr !~# '^/'
|
||||
endif
|
||||
|
||||
let toReturn = a:str
|
||||
if prependCWD
|
||||
let toReturn = getcwd() . s:Path.Slash() . a:str
|
||||
let l:result = a:pathStr
|
||||
|
||||
if l:prependWorkingDir
|
||||
let l:result = getcwd() . s:Path.Slash() . a:pathStr
|
||||
endif
|
||||
|
||||
return toReturn
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
" FUNCTION: Path.bookmarkNames() {{{1
|
||||
|
|
Loading…
Reference in New Issue
Block a user