Skip to content

Commit 7943b29

Browse files
cichlibbatsov
authored andcommitted
Fix font locking for non-alphanumeric chars in dynamic var names
1 parent 1ccef7b commit 7943b29

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
### Bugs fixed
6+
7+
* Dynamic vars whose names contain non-alphanumeric characters are now font-locked correctly.
8+
59
## 5.10.0 (2019-01-05)
610

711
### New features

clojure-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,8 @@ any number of matches of `clojure--sym-forbidden-rest-chars'."))
847847
"\\>")
848848
0 font-lock-builtin-face)
849849
;; Dynamic variables - *something* or @*something*
850-
("\\(?:\\<\\|/\\)@?\\(\\*[a-z-]*\\*\\)\\>" 1 font-lock-variable-name-face)
850+
(,(concat "\\(?:\\<\\|/\\)@?\\(\\*" clojure--sym-regexp "\\*\\)\\>")
851+
1 font-lock-variable-name-face)
851852
;; Global constants - nil, true, false
852853
(,(concat
853854
"\\<"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,8 @@ POS."
822822
(should (eq (clojure-test-face-at 2 11 "@*some-var*")
823823
'font-lock-variable-name-face))
824824
(should (eq (clojure-test-face-at 9 13 "some.ns/*var*")
825+
'font-lock-variable-name-face))
826+
(should (eq (clojure-test-face-at 1 11 "*some-var?*")
825827
'font-lock-variable-name-face)))
826828

827829
(provide 'clojure-mode-font-lock-test)

0 commit comments

Comments
 (0)