handle "fugitive:.*" files in s:repl.includes_file

When sending code to the repl from a fugitive :Gd
or :Ge, remove the "fugitive://" prefix, and
"/.git/<rev number>/" path from the buffer name.

This allows for evaluation of code from previous
revisions of a file when inside of a fugitive :Gdiff
or :Gedit window.
This commit is contained in:
Torben Rasmussen 2013-04-22 09:06:10 -07:00
parent 4f6b8e5237
commit 34e0d0c964
1 changed files with 1 additions and 0 deletions

View File

@ -155,6 +155,7 @@ endfunction
function! s:repl.includes_file(file) dict abort
let file = substitute(a:file, '\C^zipfile:\(.*\)::', '\1/', '')
let file = substitute(file, '\C^fugitive:[\/][\/]\(.*\)\.git[\/][\/][^\/]\+[\/]', '\1', '')
for path in self.path()
if file[0 : len(path)-1] ==? path
return 1