Permalink
Browse files

Stop using nrepl/take-until

We don't really need the contents of the last message anyway.
  • Loading branch information...
1 parent e9219b0 commit 3b04958845d4b3c5810283a6441f9e434522bbd4 @trptcolin committed Jul 18, 2012
Showing with 13 additions and 14 deletions.
  1. +13 −14 src/clj/reply/eval_modes/nrepl.clj
@@ -40,21 +40,20 @@
(session-sender {:op "eval" :code form :id command-id})
(reset! current-command-id command-id)
(doseq [{:keys [ns value out err] :as res}
- (#'nrepl/take-until
- #(and (= command-id (:id %))
- (some #{"done" "interrupted" "error"} (:status %)))
+ (take-while
+ #(not (and (= command-id (:id %))
+ (some #{"done" "interrupted" "error"} (:status %))))
(filter identity (session-responses session)))]
- (do
- (when (some #{"need-input"} (:status res))
- (let [input-result (.readLine *in*)]
- (.clearRawInput *in*)
- (session-sender
- {:op "stdin" :stdin (str input-result "\n")
- :id (nrepl.misc/uuid)})))
- (when value ((:value options print) value))
- (flush)
- (when (and ns (not (:session options)))
- (reset! current-ns ns))))
+ (when (some #{"need-input"} (:status res))
+ (let [input-result (.readLine *in*)]
+ (.clearRawInput *in*)
+ (session-sender
+ {:op "stdin" :stdin (str input-result "\n")
+ :id (nrepl.misc/uuid)})))
+ (when value ((:value options print) value))
+ (flush)
+ (when (and ns (not (:session options)))
+ (reset! current-ns ns)))
(when (:interactive options) (println))
(reset! current-command-id nil)
@current-ns))

0 comments on commit 3b04958

Please sign in to comment.