Skip to content

Commit 5af2e92

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

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clojure-mode.el

+2-1
Original file line numberDiff line numberDiff line change
@@ -1764,7 +1764,8 @@ no namespaces above point, return the first one in the buffer."
17641764
(save-restriction
17651765
(widen)
17661766
;; The closest ns form above point.
1767-
(when (or (re-search-backward clojure-namespace-name-regex nil t)
1767+
(when (or (and (move-end-of-line 1)
1768+
(re-search-backward clojure-namespace-name-regex nil t))
17681769
;; Or any form at all.
17691770
(and (goto-char (point-min))
17701771
(re-search-forward clojure-namespace-name-regex nil t)))

0 commit comments

Comments
 (0)