Commit 675e9be
Handle newlines between forms for
This sends the contents of the buffer. However, newlines cause the
prompt to be returned. You can see this with even a regular clojure
repl:
```bash
❯❯❯ clojure
Clojure 1.10.2
user=>
user=>
user=>
```
(note using `clj` has rlwrap which hides a bit of this so make sure to
use `clojure`).
But what we can do is make sure to transform
```clojure
(defn foo [] ...)
(defn bar [] ...)
```
into
```clojure
(defn foo [] ...)
(defn bar [] ...)
```
So that the newlines don't trigger more repl prompts. Real world usage below:
Before:
```clojure
parse=>
nil
parse=> parse=> nil
parse=> parse=> #'parse/data
parse=> parse=> #'parse/parse-where
parse=> parse=> #'parse/keywords
parse=> parse=> #'parse/tokenize
parse=>
parse=> #'parse/parse
parse=> parse=> #'parse/translate-where
parse=> parse=> nil
parse=> parse=> #'parse/query
parse=> parse=> #'parse/query-test
parse=> parse=> #'parse/bonus-points-test
parse=>
```
After:
```clojure
user=>
nil
parse=> nil
parse=> #'parse/data
parse=> #'parse/parse-where
parse=> #'parse/keywords
parse=>
parse=> #'parse/parse
parse=> #'parse/translate-where
parse=> nil
parse=> #'parse/query
parse=> #'parse/query-test
parse=> #'parse/bonus-points-test
parse=>
```inf-clojure-eval-buffer
1 parent b4193fc commit 675e9be
2 files changed
+58
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
686 | 709 | | |
687 | 710 | | |
688 | 711 | | |
689 | 712 | | |
690 | 713 | | |
691 | | - | |
692 | | - | |
693 | | - | |
694 | | - | |
695 | | - | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
696 | 720 | | |
697 | 721 | | |
698 | 722 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
122 | 151 | | |
123 | 152 | | |
124 | 153 | | |
| |||
0 commit comments