From f52625be83d6ba5509840f725885cae0263cb3ed Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 15 Mar 2013 10:00:09 +0100 Subject: [PATCH] Fix bug where vim-gitgutter tried to run for non-files. --- plugin/gitgutter.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index ed03839..b1f2528 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -60,7 +60,7 @@ function! s:file() endfunction function! s:exists_file() - return strlen(s:file()) > 0 + return filereadable(s:file()) endfunction function! s:directory_of_file() @@ -99,7 +99,7 @@ function! s:snake_case_to_camel_case(text) endfunction function! s:buffers() - return range(1, bufnr('$')) + return filter(range(1, bufnr('$')), 'buflisted(v:val)') endfunction " }}}