From fa3a63039d1f96abeff07eaf28e1ad4697754e3c Mon Sep 17 00:00:00 2001 From: James McCoy Date: Tue, 23 Jan 2018 22:20:03 -0500 Subject: [PATCH] Show an error if FileReadCmd can't open the file Signed-off-by: James McCoy --- plugin/gnupg.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index ce5c9af..f57d798 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -473,6 +473,14 @@ function s:GPGDecrypt(bufread) " File doesn't exist yet, so nothing to decrypt if !filereadable(filename) + if !a:bufread + redraw! + echohl GPGError + echom "E484: Can't open file" filename + echohl None + return + endif + " Allow the user to define actions for GnuPG buffers silent doautocmd User GnuPG silent execute ':doautocmd BufNewFile ' . fnameescape(autocmd_filename)