File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
src-shared/nextjournal/clojure_mode Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 152
152
1 (some-> % n/with-prefix n/right n/end-edge?)
153
153
-1 (some-> % n/with-prefix n/left n/start-edge?)))))]
154
154
(let [str? (n/string? parent)]
155
+ (prn :parent (n/string state parent) :str str?)
155
156
(when-let [target (case direction 1 (first (remove n/line-comment? (n/rights (n/with-prefix parent))))
156
157
-1 (first (remove n/line-comment? (n/lefts (n/with-prefix parent)))))]
157
158
{:cursor/mapped from
163
164
(-> edge
164
165
n/from-to
165
166
(cond->
166
- (not str?) (j/assoc! :insert " " )))])
167
+ true #_ (not str?) (j/assoc! :insert " " )))])
167
168
-1
168
169
(let [^string edge (n/left-edge-with-prefix state parent)
169
170
start (n/start (n/with-prefix parent))]
170
171
[(cond-> {:from start
171
- :to (+ start (count edge))}
172
+ :to (+ start (count edge))
173
+ #_#_:insert " " }
172
174
(not str?) (j/assoc! :insert " " ))
173
175
{:from (n/start target)
174
176
:insert edge}]))}))))))))
Original file line number Diff line number Diff line change 8
8
[nextjournal.clojure-mode.commands :as commands]
9
9
[nextjournal.clojure-mode.extensions.formatting :as format]
10
10
[nextjournal.clojure-mode.extensions.eval-region :as eval-region]
11
+ [nextjournal.scratch]
11
12
#?@(:squint []
12
13
:cljs [[nextjournal.livedoc :as livedoc]])
13
14
#?(:squint [" assert" :as assert]))
14
15
#? (:squint (:require-macros [nextjournal.clojure-mode-tests.macros :refer [deftest are testing is]])))
15
16
17
+ #_(js/process.exit 0 )
18
+
16
19
(def extensions
17
20
(.concat cm-clojure/default-extensions (eval-region/extension #js {}))
18
21
; ; optionally test with live grammar
Original file line number Diff line number Diff line change 1
- (ns nextjournal.clojure-mode. scratch
1
+ (ns nextjournal.scratch
2
2
(:require [nextjournal.clojure-mode.commands :as commands]
3
3
[nextjournal.clojure-mode :as cm-clojure]
4
4
[nextjournal.clojure-mode.extensions.eval-region :as eval-region]
9
9
10
10
(def apply-f (partial test-utils/apply-f extensions))
11
11
12
- (js/console.log " \" | \" 1 " )
13
- (js/console.log (apply-f (commands/slurp 1 ) " \" | \" 1 " ))
12
+ (js/console.log " a ;; hello \n (|) " )
13
+ (js/console.log (apply-f (commands/slurp - 1 ) " a ;; hello \n (|) " ))
14
14
You can’t perform that action at this time.
0 commit comments