Multiple cites are put in one \cite{}. Correct bibtex ref

If you select multiple papers at once, they are put in the same cite
bracket (comma separated). "/" is substituted out of the id. Since this
also happens for the bibtex refs.
This commit is contained in:
Klaas Gunst 2018-10-26 14:26:28 +02:00
parent 14d893d010
commit 023cdd322a

View File

@ -26,14 +26,11 @@ function! s:handler(a)
let candidates = [] let candidates = []
for line in citations for line in citations
let id = matchlist(line, pat)[1] let id = matchlist(line, pat)[1]
call add(candidates, "\\cite{". id . "}") call add(candidates, substitute(id, "/", "", "g"))
endfor endfor
endif endif
for candidate in candidates execute "normal a\\cite{" . join(candidates, ", ") . "}\egql"
execute join([cmd, candidate])
endfor
endfunction endfunction