Skip to content

Commit 46cf900

Browse files
committed
make quit-prompt configurable
1 parent 4d1bbd6 commit 46cf900

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/clj/cljs/repl.clj

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,9 @@
623623
(doseq [file (comp/cljs-files-in src-dir)]
624624
(ana/analyze-file (str "file://" (.getAbsolutePath file)) opts)))))
625625

626+
(defn repl-quit-prompt []
627+
(println "To quit, type:" :cljs/quit))
628+
626629
(defn repl-prompt []
627630
(print (str "ClojureScript:" ana/*cljs-ns* "> ")))
628631

@@ -644,12 +647,13 @@
644647
(.printStackTrace e))))
645648

646649
(defn repl*
647-
[repl-env {:keys [init need-prompt prompt flush read eval print caught reader
650+
[repl-env {:keys [init need-prompt quit-prompt prompt flush read eval print caught reader
648651
print-no-newline source-map-inline wrap repl-requires
649652
compiler-env]
650653
:or {need-prompt #(if (readers/indexing-reader? *in*)
651654
(== (readers/get-column-number *in*) 1)
652655
(identity true))
656+
quit-prompt repl-quit-prompt
653657
prompt repl-prompt
654658
flush flush
655659
read repl-read
@@ -760,7 +764,7 @@
760764
(binding [*in* (if (true? (:source-map-inline opts))
761765
*in*
762766
(reader))]
763-
(print "To quit, type:" :cljs/quit)
767+
(quit-prompt)
764768
(prompt)
765769
(flush)
766770
(loop []

0 commit comments

Comments
 (0)