Skip to content

Commit

Permalink
Merge pull request #58 from daisybytes/improve-remote-repl-support
Browse files Browse the repository at this point in the history
Minor improvements for remote-repl functionality
  • Loading branch information
mogenslund authored Jun 5, 2021
2 parents d9bc68d + a230224 commit 371f2b5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/liq/extras/cool_stuff.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
(when @socket
(let [l (.readLine (@socket :reader))]
(when l
(editor/message l)
(editor/message l :append true)
(recur)))))))))
([] (jack-in "5555")))

Expand All @@ -48,6 +48,12 @@
(buffer/sexp-at-point buf))]
(send-to-repl sexp)))

(defn send-current-buffer-to-repl
[]
(-> (editor/current-buffer)
(buffer/text)
(send-to-repl)))

(defn output-split
([n]
(editor/set-setting :auto-switch-to-output false)
Expand All @@ -70,7 +76,9 @@
(swap! editor/state assoc-in [::editor/commands :jack-out] jack-out)
(swap! editor/state assoc-in [::editor/commands :output-split] output-split)
(editor/add-key-bindings :clojure-mode :normal
{"f5" #(send-sexp-at-point-to-repl (editor/current-buffer))
{"f4" #(send-current-buffer-to-repl)
"f5" #(send-sexp-at-point-to-repl (editor/current-buffer))
"f6" jack-out})
(editor/add-key-bindings :clojure-mode :visual
{"f5" #(send-sexp-at-point-to-repl (editor/current-buffer))}))
{"f4" #(send-current-buffer-to-repl)
"f5" #(send-sexp-at-point-to-repl (editor/current-buffer))}))

0 comments on commit 371f2b5

Please sign in to comment.