Skip to content

Commit 70c1ac6

Browse files
rvlobbatsov
authored andcommitted
Fix for character literal font-lock (#588)
When inside a vector or before white space, some escaped characters, like comma, square and curly brackets, weren't being formatted. * Added tests. * Added examples in test.clj for visual inspection.
1 parent c211a27 commit 70c1ac6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

clojure-mode-font-lock-test.el

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,22 @@ DESCRIPTION is the description of the spec."
942942
("\\"
943943
(1 2 clojure-character-face)))
944944

945+
(when-fontifying-it "should handle characters not by themselves"
946+
("[\\,,]"
947+
(1 1 nil)
948+
(2 3 clojure-character-face)
949+
(4 5 nil))
950+
951+
("[\\[]"
952+
(1 1 nil)
953+
(2 3 clojure-character-face)
954+
(4 4 nil)))
955+
956+
(when-fontifying-it "should handle % character literal"
957+
("#(str \\% %)"
958+
(7 8 clojure-character-face)
959+
(10 10 font-lock-variable-name-face)))
960+
945961
(when-fontifying-it "should handle referred vars"
946962
("foo/var"
947963
(1 3 font-lock-type-face))

0 commit comments

Comments
 (0)