Refactor the "Path" constructor

This commit is contained in:
Jason Franklin
2018-01-06 08:35:34 -05:00
parent 5fc48b0b13
commit f4df038366

View File

@@ -541,17 +541,16 @@ function! s:Path.equals(path)
return self.str() ==# a:path.str() return self.str() ==# a:path.str()
endfunction endfunction
" FUNCTION: Path.New() {{{1 " FUNCTION: Path.New(pathStr) {{{1
" The Constructor for the Path object function! s:Path.New(pathStr)
function! s:Path.New(path) let l:newPath = copy(self)
let newPath = copy(self)
call newPath.readInfoFromDisk(s:Path.AbsolutePathFor(a:path)) call l:newPath.readInfoFromDisk(s:Path.AbsolutePathFor(a:pathStr))
let newPath.cachedDisplayString = "" let l:newPath.cachedDisplayString = ''
let newPath.flagSet = g:NERDTreeFlagSet.New() let l:newPath.flagSet = g:NERDTreeFlagSet.New()
return newPath return l:newPath
endfunction endfunction
" FUNCTION: Path.Slash() {{{1 " FUNCTION: Path.Slash() {{{1