File tree 2 files changed +6
-5
lines changed
src-shared/nextjournal/clojure_mode/extensions
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 15
15
(= \\ (.. state -doc (slice (max 0 (dec pos)) pos) toString)))
16
16
17
17
(defn backspace-backoff [state from to]
18
+ #_ (js/console.log (some-> (n/|node state from) (u/guard n/line-comment?)))
18
19
(if
19
20
; ; handle line-comments (backspace should not drag forms up into line comments)
20
21
(and
21
- ; ; we are directly in front of a line-comment
22
+ ; ; we are directly in right of a line-comment
22
23
(some-> (n/node| state (dec from)) (u/guard n/line-comment?))
23
- ; ; current line is blank
24
- (not (str/blank? (u/line-content-at state from))))
24
+ ; ; current line is blank or we're left of a line-comment
25
+ (not (or (str/blank? (u/line-content-at state from))
26
+ (some-> (n/|node state from) (u/guard n/line-comment?)))))
25
27
{:cursor (dec from)}
26
28
(u/deletion from to)))
27
29
Original file line number Diff line number Diff line change 125
125
" \" [|]\" " " \" |]\" " ; ; normal deletion inside strings
126
126
" ( ;;\n |)" " ( ;;|\n )" ; ; don't put paren behind line comment
127
127
" ( ;|\n )" " ( |\n )"
128
- " (;;\n |;;\n )" " (;;|\n ;;\n )"
129
- ))
128
+ " (;;\n |;;\n )" " (;;|;;\n )" ))
130
129
131
130
#?(:squint nil
132
131
:cljs (testing " handle backspace (embedded)"
You can’t perform that action at this time.
0 commit comments