From c1f9b02a01e0905aadb344bdb32b7c840fb63e0a Mon Sep 17 00:00:00 2001 From: johnstef99 Date: Sun, 11 Sep 2022 12:34:56 +0300 Subject: [PATCH] check if file is readable --- autoload/phpfmt/fmt.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/autoload/phpfmt/fmt.vim b/autoload/phpfmt/fmt.vim index 9cf5973..8d7f593 100644 --- a/autoload/phpfmt/fmt.vim +++ b/autoload/phpfmt/fmt.vim @@ -10,6 +10,10 @@ function! phpfmt#fmt#autoformat() abort "{{{ endfunction "}}} function! phpfmt#fmt#format() abort "{{{ + if !filereadable(expand('%')) + return + endif + if g:phpfmt_experimental == 1 " Using winsaveview to save/restore cursor state has the problem of " closing folds on save. One fix is to use mkview instead. Unfortunately,