Skip to content

Commit 88f75d0

Browse files
committed
Don't highlight vars with colons as keywords
Changes syntax highlighting regexp for keywords to match a colon/double-colon only at the beginning of a word, not in the middle. This allows local vars like `foo:bar` to be highlighted correctly instead of like an unknown symbol for the part before the colon and a keyword for the rest. Fixes clojure-emacs#653
1 parent 481ca48 commit 88f75d0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clojure-mode.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -1072,12 +1072,13 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
10721072
;; keywords: {:oneword/ve/yCom|pLex.stu-ff 0}
10731073
(,(concat "\\(:\\{1,2\\}\\)\\(" clojure--keyword-sym-regexp "?\\)\\(/\\)"
10741074
"\\(" clojure--keyword-sym-regexp "\\)")
1075+
;; with ns
10751076
(1 'clojure-keyword-face)
10761077
(2 font-lock-type-face)
1077-
;; (2 'clojure-keyword-face)
10781078
(3 'default)
10791079
(4 'clojure-keyword-face))
1080-
(,(concat "\\(:\\{1,2\\}\\)\\(" clojure--keyword-sym-regexp "\\)")
1080+
(,(concat "\\<\\(:\\{1,2\\}\\)\\(" clojure--keyword-sym-regexp "\\)")
1081+
;; without ns
10811082
(1 'clojure-keyword-face)
10821083
(2 'clojure-keyword-face))
10831084

0 commit comments

Comments
 (0)