use reletive paths for edit commands if possible

This commit is contained in:
Martin Grenfell 2008-11-30 20:05:54 +13:00
parent f4c455bc2f
commit 96215c5da6

View File

@ -1539,12 +1539,21 @@ endfunction
"Return: the string for this path that is suitable to be used with the :edit
"command
function! s:Path.strForEditCmd()
let p = self.str(1)
let cwd = getcwd()
if s:running_windows
return self.strForOS(0)
else
return self.str(1)
let p = tolower(self.strForOS(0))
let cwd = tolower(getcwd())
endif
"return a relative path if we can
if stridx(p, cwd) == 0
let p = strpart(p, strlen(cwd)+1)
endif
return p
endfunction
"FUNCTION: Path.strForGlob() {{{3
function! s:Path.strForGlob()