From 9afeebf32e9bfd2a3ffc8f3e50e68651f88afaa8 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 21 Oct 2012 23:21:12 -0400 Subject: [PATCH] Provide failsafe for foldtext filename Closes #216. --- plugin/fugitive.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 03eb4f3..f62c362 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2500,6 +2500,9 @@ function! fugitive#foldtext() abort if filename ==# '' let filename = matchstr(getline(v:foldstart), '^diff .\{-\} a/\zs.*\ze b/') endif + if filename ==# '' + let filename = getline(v:foldstart)[5:-1] + endif if exists('binary') return 'Binary: '.filename else