Skip to content

Commit 802c1db

Browse files
committed
[Fix #355] Font-lock properly single-char ns aliases
1 parent c315236 commit 802c1db

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

clojure-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ See the for-loop: URL `http://git.io/vRGTj' lines: URL
407407
`http://git.io/vRGIh', URL `http://git.io/vRGLE' and value
408408
definition of 'macros': URL `http://git.io/vRGLD'.")
409409
(defconst clojure--sym-regexp
410-
(concat "[^" clojure--sym-forbidden-1st-chars "][^" clojure--sym-forbidden-rest-chars "]+")
410+
(concat "[^" clojure--sym-forbidden-1st-chars "][^" clojure--sym-forbidden-rest-chars "]*")
411411
"A regexp matching a Clojure symbol or namespace alias.
412412
Matches the rule `clojure--sym-forbidden-1st-chars' followed by
413413
any number of matches of `clojure--sym-forbidden-rest-chars'."))

test/clojure-mode-font-lock-test.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,15 @@ POS."
163163
(clojure-test-with-temp-buffer "clo.core/something"
164164
(should (eq (clojure-test-face-at 9 9) 'default))
165165
(should (eq (clojure-test-face-at 1 8) 'font-lock-type-face))
166-
(should (eq (clojure-test-face-at 10 18) nil))))
166+
(should (eq (clojure-test-face-at 10 18) nil)))
167+
(clojure-test-with-temp-buffer "a/something"
168+
(should (eq (clojure-test-face-at 1 1) 'font-lock-type-face))
169+
(should (eq (clojure-test-face-at 3 12) 'nil))
170+
(should (eq (clojure-test-face-at 2 2) 'default)))
171+
(clojure-test-with-temp-buffer "abc/something"
172+
(should (eq (clojure-test-face-at 1 3) 'font-lock-type-face))
173+
(should (eq (clojure-test-face-at 5 14) 'nil))
174+
(should (eq (clojure-test-face-at 4 4) 'default))))
167175

168176
(ert-deftest clojure-mode-syntax-table/static-method ()
169177
:tags '(fontification syntax-table)

0 commit comments

Comments
 (0)