From 05a3e4e1f69aa5b91b16abc6b6502e2abd822b75 Mon Sep 17 00:00:00 2001 From: Markus Braun Date: Tue, 16 Feb 2010 07:40:41 +0000 Subject: [PATCH] Reworked patch by James Vega because I don't like "continue". --- plugin/gnupg.vim | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/plugin/gnupg.vim b/plugin/gnupg.vim index 6bef158..1171b4f 100644 --- a/plugin/gnupg.vim +++ b/plugin/gnupg.vim @@ -1054,35 +1054,34 @@ function s:GPGNameToID(name) let duplicates = {} let choices = "The name \"" . a:name . "\" is ambiguous. Please select the correct key:\n" for line in lines + + " check if this line has already been processed if !has_key(duplicates, line) let duplicates[line] = 1 - else - " Exact line has already been seen. Probably multiple keyrings being - " searched with the same data. - continue - endif - let fields = split(line, ":") - " search for the next uid - if (pubseen == 1) - if (fields[0] == "uid") - let choices = choices . " " . fields[9] . "\n" - else - let pubseen = 0 - endif - endif - " search for the next pub - if (pubseen == 0) - if (fields[0] == "pub") - let identity = fields[4] - let gpgids += [identity] - if exists("*strftime") - let choices = choices . counter . ": ID: 0x" . identity . " created at " . strftime("%c", fields[5]) . "\n" + let fields = split(line, ":") + " search for the next uid + if (pubseen == 1) + if (fields[0] == "uid") + let choices = choices . " " . fields[9] . "\n" else - let choices = choices . counter . ": ID: 0x" . identity . "\n" + let pubseen = 0 + endif + endif + + " search for the next pub + if (pubseen == 0) + if (fields[0] == "pub") + let identity = fields[4] + let gpgids += [identity] + if exists("*strftime") + let choices = choices . counter . ": ID: 0x" . identity . " created at " . strftime("%c", fields[5]) . "\n" + else + let choices = choices . counter . ": ID: 0x" . identity . "\n" + endif + let counter = counter+1 + let pubseen = 1 endif - let counter = counter+1 - let pubseen = 1 endif endif