File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1783,12 +1783,16 @@ Quitting closes all active nREPL connections and kills all CIDER buffers."
17831783If PROMPT-PROJECT is t, then prompt for the project in which to
17841784restart the server."
17851785 (interactive " P" )
1786- (cider-quit)
1787- ; ; Workaround for a nasty race condition https://github.com/clojure-emacs/cider/issues/439
1788- ; ; TODO: Find a better way to ensure `cider-quit' has finished
1789- (message " Waiting for CIDER to quit... " )
1790- (sleep-for 2 )
1791- (cider-jack-in prompt-project))
1786+ (let ((project-dir (with-current-buffer (nrepl-current-connection-buffer) nrepl-project-dir)))
1787+ (cider-quit)
1788+ ; ; Workaround for a nasty race condition https://github.com/clojure-emacs/cider/issues/439
1789+ ; ; TODO: Find a better way to ensure `cider-quit' has finished
1790+ (message " Waiting for CIDER to quit... " )
1791+ (sleep-for 2 )
1792+ (if project-dir
1793+ (let ((default-directory project-dir))
1794+ (cider-jack-in prompt-project))
1795+ (error " Can't restart CIDER for unknown project " ))))
17921796
17931797(add-hook 'nrepl-connected-hook 'cider-enable-on-existing-clojure-buffers )
17941798(add-hook 'nrepl-disconnected-hook
You can’t perform that action at this time.
0 commit comments