Skip to content

Commit cd6b6fb

Browse files
committed
Avoid waiting for cljr-slash when typing out a reader literal.
1 parent f5f44fd commit cd6b6fb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clj-refactor.el

+7-1
Original file line numberDiff line numberDiff line change
@@ -1956,6 +1956,11 @@ the alias in the project."
19561956
(cljr--goto-closest-ns)
19571957
(looking-at-p "(\\s-*in-ns")))
19581958

1959+
(defun cljr--in-reader-literal-p ()
1960+
(save-excursion
1961+
(clojure-backward-logical-sexp 1)
1962+
(looking-at-p "#")))
1963+
19591964
;;;###autoload
19601965
(defun cljr-slash ()
19611966
"Inserts / as normal, but also checks for common namespace shorthands to require.
@@ -1966,7 +1971,8 @@ form."
19661971
(interactive)
19671972
(insert "/")
19681973
(unless (or (cljr--in-map-destructuring?)
1969-
(cljr--in-ns-above-point-p))
1974+
(cljr--in-ns-above-point-p)
1975+
(cljr--in-reader-literal-p))
19701976
(when-let (aliases (and cljr-magic-requires
19711977
(not (cider-in-comment-p))
19721978
(not (cider-in-string-p))

0 commit comments

Comments
 (0)