Skip to content

Commit 0a78ad2

Browse files
tanzoniteblackkommen
authored andcommitted
@(dynamic)variable shouldn't break fontlock
Currently `foo/some-var` will fontlock `foo`, but if this item is something that can be dereffed and you type `@foo/some-var`, `foo` is no longer font-locked. Similarly: `*dynamic-var*` is font locked, but `@` breaks the regex. In this change the `@` sign isn't font locked, but the var that follows it is. Conflicts: clojure-mode.el Add tests for dynamic-var and ns/refer fontlock
1 parent f1af028 commit 0a78ad2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

clojure-mode-test.el

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ POS."
202202
(should (eq (clojure-test-face-at 1 5 "#+clj x") 'font-lock-preprocessor-face))
203203
(should (eq (clojure-test-face-at 1 6 "#+cljs x") 'font-lock-preprocessor-face)))
204204

205+
(ert-deftest clojure-mode-syntax-table/refer-ns ()
206+
:tags '(fontification syntax-table)
207+
(should (eq (clojure-test-face-at 1 3 "foo/var") 'font-lock-type-face))
208+
(should (eq (clojure-test-face-at 2 4 "@foo/var") 'font-lock-type-face)))
209+
210+
(ert-deftest clojure-mode-syntax-table/dynamic-var ()
211+
:tags '(fontification syntax-table)
212+
(should (eq (clojure-test-face-at 1 10 "*some-var*") 'font-lock-variable-name-face))
213+
(should (eq (clojure-test-face-at 2 11 "@*some-var*") 'font-lock-variable-name-face)))
214+
205215
(provide 'clojure-mode-test)
206216

207217
;; Local Variables:

0 commit comments

Comments
 (0)