From 7150159ebff18c06ff6c8bc2f27323c966b5b71a Mon Sep 17 00:00:00 2001 From: Jerome Reybert Date: Thu, 30 Oct 2014 11:06:14 +0100 Subject: [PATCH] do not initialize plugin for non readable files for example, fugitive is using temporary files like fugitive:///myfile.c for Gdiff, Gedit operations --- plugin/clang.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/clang.vim b/plugin/clang.vim index c720dd1..54826f1 100644 --- a/plugin/clang.vim +++ b/plugin/clang.vim @@ -123,7 +123,7 @@ au FileType c,cpp call ClangCompleteInit(0) "}}} "{{{ s:IsValidFile func! s:IsValidFile() - return &filetype == "c" || &filetype == "cpp" + return ( &filetype == "c" || &filetype == "cpp" ) && filereadable(expand("%")) endf "}}} "{{{ s:PDebug