From 181ed597f2c27cea99b5e291b994254d3ef3253f Mon Sep 17 00:00:00 2001 From: James McCoy Date: Wed, 30 May 2012 22:18:01 -0400 Subject: [PATCH] Suppress "N more lines" message when editing a file Signed-off-by: James McCoy --- plugin/gnupg.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 8bfda97..1e191bd 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -377,6 +377,10 @@ function s:GPGDecrypt(bufread) let cmd.args = '--verbose --decrypt --list-only --dry-run --batch --no-use-agent --logger-fd 1 ' . shellescape(filename) let output = s:GPGSystem(cmd) + " Suppress the "N more lines" message when editing a file, not when reading + " the contents of a file into a buffer + let silent = a:bufread ? 'silent ' : '' + let asymmPattern = 'gpg: public key is \%(0x\)\=[[:xdigit:]]\{8,16}' " check if the file is symmetric/asymmetric encrypted if (match(output, "gpg: encrypted with [[:digit:]]\\+ passphrase") >= 0) @@ -429,7 +433,7 @@ function s:GPGDecrypt(bufread) echohl GPGWarning echom "File is not encrypted, all GPG functions disabled!" echohl None - silent exe '.r ' . fnameescape(filename) + exe printf('%sr %s', silent, fnameescape(filename)) call s:GPGDebug(3, "<<<<<<<< Leaving s:GPGDecrypt()") return endif @@ -444,7 +448,7 @@ function s:GPGDecrypt(bufread) " since even with the --quiet option passphrase typos will be reported, " we must redirect stderr (using shell temporarily) call s:GPGDebug(1, "decrypting file") - let cmd = { 'level': 1, 'ex': 'r !' } + let cmd = { 'level': 1, 'ex': silent . 'r !' } let cmd.args = '--quiet --decrypt ' . shellescape(filename, 1) call s:GPGExecute(cmd)