tpope / vim-fireplace

fireplace.vim: Clojure REPL support
https://www.vim.org/scripts/script.php?script_id=4978
1.75k stars 139 forks source link

Fix for spaces in cider-nrepl's classpath op #174

Closed ghost closed 10 years ago

ghost commented 10 years ago

Cider-nrepl's classpath op currently returns paths with URL-encoded spaces in it, at least on Windows systems. This, when using the Python branch in fireplace#jar_contents(), causes any eval that results in a traceback to fail with Vim(python):Traceback (most recent call last):, as we try to use Python's ZipFile class to load a path that has a '%20' in it.

I'm not sure if the zipinfo branch is affected, or if URL-encoded paths are treated differently on Unix systems, but I would guess this hasn't been an issue until now because spaces don't show up very often in Unix file systems.

This fix simply (roughly) URL-decodes the result of the classpath op on the Vimscript side.

An ideal fix would be to get cider-nrepl's classpath op to not return URL-encoded strings, but I'm not sure changing their relatively public-facing API at this point is a good idea.

tpope commented 10 years ago

cider-nrepl is still pre-1.0 and fixing it would only cause a regression for paths with a literal % in them. I say start there.

ghost commented 10 years ago

Good point, I'll give it a go.