motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit ca4e18c81f1ce369e13bad0c591b987d9d59784c (tree)
parent 1eeff6c3491fb20604883e38adf4dea398fb6678
Author: Tim Pope <code@tpope.net>
Date:   Sat, 26 Feb 2011 12:39:13 -0500

Allow -/ and :/ to refer to current work tree file

Diffstat:
Mplugin/fugitive.vim | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim @@ -445,6 +445,8 @@ endfunction function! s:buffer_expand(rev) dict abort if a:rev =~# '^:[0-3]$' let file = a:rev.self.path(':') + elseif a:rev =~# '^[-:]/$' + let file = '/'.self.path() elseif a:rev =~# '^-' let file = 'HEAD^{}'.a:rev[1:-1].self.path(':') elseif a:rev =~# '^@{' @@ -455,7 +457,7 @@ function! s:buffer_expand(rev) dict abort else let file = a:rev endif - return s:sub(s:sub(file,'\%$',self.path()),'/$','') + return s:sub(s:sub(file,'\%$',self.path()),'\.\@<=/$','') endfunction function! s:buffer_containing_commit() dict abort