From 34e0d0c9640705a6ccb30736010dd7d34b7b4678 Mon Sep 17 00:00:00 2001 From: Torben Rasmussen Date: Mon, 22 Apr 2013 09:06:10 -0700 Subject: [PATCH] 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//" 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. --- plugin/fireplace.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index 3aa00db..74b9c7c 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -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