Reworked patch by James Vega because I don't like "continue".
This commit is contained in:
parent
82e70cf70a
commit
05a3e4e1f6
@ -1054,35 +1054,34 @@ function s:GPGNameToID(name)
|
|||||||
let duplicates = {}
|
let duplicates = {}
|
||||||
let choices = "The name \"" . a:name . "\" is ambiguous. Please select the correct key:\n"
|
let choices = "The name \"" . a:name . "\" is ambiguous. Please select the correct key:\n"
|
||||||
for line in lines
|
for line in lines
|
||||||
|
|
||||||
|
" check if this line has already been processed
|
||||||
if !has_key(duplicates, line)
|
if !has_key(duplicates, line)
|
||||||
let duplicates[line] = 1
|
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
|
let fields = split(line, ":")
|
||||||
if (pubseen == 0)
|
" search for the next uid
|
||||||
if (fields[0] == "pub")
|
if (pubseen == 1)
|
||||||
let identity = fields[4]
|
if (fields[0] == "uid")
|
||||||
let gpgids += [identity]
|
let choices = choices . " " . fields[9] . "\n"
|
||||||
if exists("*strftime")
|
|
||||||
let choices = choices . counter . ": ID: 0x" . identity . " created at " . strftime("%c", fields[5]) . "\n"
|
|
||||||
else
|
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
|
endif
|
||||||
let counter = counter+1
|
|
||||||
let pubseen = 1
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user