Include leading / in buffer().rev()

Slowly pave the way for relative paths.
This commit is contained in:
Tim Pope 2012-04-07 15:42:09 -04:00
parent b18bb05b91
commit 48daf7ae72

View File

@ -65,7 +65,7 @@ function! s:shellslash(path)
endfunction
function! s:recall()
let rev = s:buffer().rev()
let rev = s:sub(s:buffer().rev(), '^/', '')
if rev ==# ':'
return matchstr(getline('.'),'^#\t\%([[:alpha:] ]\+: *\)\=\zs.\{-\}\ze\%( (new commits)\)\=$\|^\d\{6} \x\{40\} \d\t\zs.*')
endif
@ -497,7 +497,7 @@ function! s:buffer_rev() dict abort
elseif self.spec() =~ '\.git/refs/\|\.git/.*HEAD$'
return self.spec()[strlen(self.repo().dir())+1 : -1]
else
return self.path()
return self.path('/')
endif
endfunction