Skip to content

Commit 4af74ac

Browse files
committed
Move to top-level before re-search-backward in clojure-find-ns
Moving to top level avoids improper matching behavior due to being in middle of match. Fix clojure-emacs/cider#2100
1 parent 05b6f05 commit 4af74ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clojure-mode.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,6 +1763,10 @@ no namespaces above point, return the first one in the buffer."
17631763
(save-excursion
17641764
(save-restriction
17651765
(widen)
1766+
1767+
;; Move to top-level to avoid searching from inside ns
1768+
(ignore-errors (while t (up-list nil t t)))
1769+
17661770
;; The closest ns form above point.
17671771
(when (or (re-search-backward clojure-namespace-name-regex nil t)
17681772
;; Or any form at all.

0 commit comments

Comments
 (0)