add oPath#ExtractDriveLetter

If running windows, extract and cache the drive letter
This commit is contained in:
Martin Grenfell 2008-05-10 12:40:26 +12:00
parent e6479c36f3
commit 7275d89a35

View File

@ -950,6 +950,17 @@ function! s:oPath.Delete() dict
endif endif
endfunction endfunction
"FUNCTION: oPath.ExtractDriveLetter(fullpath) {{{3
"
"If running windows, cache the drive letter for this path
function! s:oPath.ExtractDriveLetter(fullpath) dict
if s:running_windows
let self.drive = substitute(a:fullpath, '\(^[a-zA-Z]:\).*', '\1', '')
else
let self.drive = ''
endif
endfunction
"FUNCTION: oPath.GetDir() {{{3 "FUNCTION: oPath.GetDir() {{{3
" "
"Returns this path if it is a directory, else this paths parent. "Returns this path if it is a directory, else this paths parent.