Source/Doc lookup fails when result buffer already open
I'm using vimclojure as of changeset 340e7b1efe4e.
Here's how I reproduce the bug:
- Start up nailgun
- Start up vim and open a clojure file
- Put the cursor on a word and hit ,lw
- Do not close the result window
- Now hit ,sw
The contents (doc of word) of the result window should be replaced with the source of the word, but instead I get an error:
Vim(call):E118: Too many arguments for function: 377
Error detected while processing function vimclojure#SourceLookup..376..vimclojure#util#WithSavedOption..vimclojure#util#WithSaved..449: line 3: E118: Too many arguments for function: 377 Error detected while processing function vimclojure#SourceLookup..376: line 14: E171: Missing :endif
This only seems to happen if the result buffer is already open with a different kind of result (source vs. doc) showing.
I've stepped through ":debug call vimclojure#SourceLookup("ns")" with the same result, but with the closures and my vimscript ignorance, it's hard to see which function is actually throwing the exception.