commit 7275d89a3540b6bda72740736de9a3aef92c887b
parent e6479c36f3d8bad8238cb5442b2d75d3943b105b
Author: Martin Grenfell <martin_grenfell@msn.com>
Date: Sat, 10 May 2008 12:40:26 +1200
add oPath#ExtractDriveLetter
If running windows, extract and cache the drive letter
Diffstat:
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -950,6 +950,17 @@ function! s:oPath.Delete() dict
endif
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
"
"Returns this path if it is a directory, else this paths parent.