From 7275d89a3540b6bda72740736de9a3aef92c887b Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sat, 10 May 2008 12:40:26 +1200 Subject: [PATCH] add oPath#ExtractDriveLetter If running windows, extract and cache the drive letter --- plugin/NERD_tree.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index bbb6b09..41b9715 100644 --- 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.