File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 3
3
## master (unreleased)
4
4
5
5
### Changes
6
-
6
+ - [ # 3754 ] ( https://github.com/clojure-emacs/cider/issues/3754 ) : Fix regex in ` cider-ns-from-p ` .
7
7
- [ #3753 ] ( https://github.com/clojure-emacs/cider/pull/3753 ) : Add ` cider-log-show-frameworks ` command to show available log frameworks in a buffer.
8
8
- [ #3746 ] ( https://github.com/clojure-emacs/cider/issues/3746 ) : Bring back ` cider ` completion style for activating backend-driven completion.
9
9
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ EVAL-BUFFER is the buffer where the spinner was started."
108
108
; ;; Evaluation helpers
109
109
(defun cider-ns-form-p (form )
110
110
" Check if FORM is an ns form."
111
- (string-match-p " ^ [[:space:]]*\( ns\\ ([[:space:]]*$\\ |[[:space:]]+\\ )" form))
111
+ (string-match-p " \\ ` [[:space:]]*\( ns\\ ([[:space:]]*$\\ |[[:space:]]+\\ )" form))
112
112
113
113
(defun cider-ns-from-form (ns-form )
114
114
" Get ns substring from NS-FORM."
Original file line number Diff line number Diff line change 132
132
(expect (cider-ensure-op-supported " foo" )
133
133
:to-throw 'user-error )))
134
134
135
+ (describe " cider-ns-form-p"
136
+ (it " doesn't match ns in a string"
137
+ (let ((ns-in-string " \"\n (ns bar)\n\" " ))
138
+ (expect (cider-ns-form-p ns-in-string) :to-equal nil )))
139
+ (it " matches ns"
140
+ (let ((ns " (ns bar)\n " ))
141
+ (expect (cider-ns-form-p ns) :to-equal 0 )))
142
+ (it " matches ns with leading spaces"
143
+ (let ((ns " (ns bar)\n " ))
144
+ (expect (cider-ns-form-p ns) :to-equal 0 ))))
145
+
135
146
(describe " cider-expected-ns"
136
147
(before-each
137
148
(spy-on 'cider-connected-p :and-return-value t )
You can’t perform that action at this time.
0 commit comments