Skip to content

Commit b5430c6

Browse files
committed
Fontify ~N & ~T sigils
1 parent b71145e commit b5430c6

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

elixir-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
(or "_" "__MODULE__" "__DIR__" "__ENV__" "__CALLER__"
168168
"__block__" "__aliases__")
169169
symbol-end))
170-
(sigils . ,(rx "~" (or "B" "C" "D" "R" "S" "b" "c" "r" "s" "w")))))
170+
(sigils . ,(rx "~" (or "B" "C" "D" "N" "R" "S" "T" "b" "c" "r" "s" "w")))))
171171

172172
(defmacro elixir-rx (&rest sexps)
173173
(let ((rx-constituents (append elixir-rx-constituents rx-constituents)))

test/elixir-mode-font-test.el

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,9 @@ end"
367367
~s\"\"\"
368368
foo
369369
\"\"\"
370-
~D(\")"
370+
~D(\")
371+
~N(\")
372+
~T(\")"
371373
(should-not (eq (elixir-test-face-at 5) 'font-lock-string-face)) ; ~s//
372374

373375
(should-not (eq (elixir-test-face-at 7) 'font-lock-string-face)) ; ~r||
@@ -403,7 +405,11 @@ foo
403405
(should (eq (elixir-test-face-at 53) 'font-lock-string-face))
404406
(should (eq (elixir-test-face-at 55) 'font-lock-string-face))
405407

406-
(should (eq (elixir-test-face-at 66) 'font-lock-string-face)))) ; ~D()
408+
(should (eq (elixir-test-face-at 66) 'font-lock-string-face)) ; ~D()
409+
410+
(should (eq (elixir-test-face-at 72) 'font-lock-string-face)) ; ~N()
411+
412+
(should (eq (elixir-test-face-at 78) 'font-lock-string-face)))) ; ~T()
407413

408414
(ert-deftest elixir-mode-syntax-table/hashmark-in-sigils ()
409415
"Don't treat hashmark in sigils as comment"

0 commit comments

Comments
 (0)