diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index c3a9c56..d913bea 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1072,6 +1072,7 @@ endfunction " Gedit, Gpedit, Gsplit, Gvsplit, Gtabedit, Gread {{{1 function! s:Edit(cmd,bang,...) abort + let buffer = s:buffer() if a:cmd !~# 'read' if &previewwindow && getbufvar('','fugitive_type') ==# 'index' wincmd p @@ -1091,7 +1092,7 @@ function! s:Edit(cmd,bang,...) abort if a:bang let args = s:gsub(a:0 ? a:1 : '', '\\@' - let file = s:buffer().path(':') + elseif buffer.commit() ==# '' && buffer.path('/') !~# '^/.git\>' + let file = buffer.path(':') else - let file = s:buffer().path('/') + let file = buffer.path('/') endif try - let file = s:repo().translate(file) + let file = buffer.repo().translate(file) catch /^fugitive:/ return 'echoerr v:errmsg' endtry