Skip to content

Commit

Permalink
Merge pull request #373 from rranelli/master
Browse files Browse the repository at this point in the history
Fontify ~D() sigil
  • Loading branch information
tonini authored Sep 21, 2016
2 parents 1d04044 + 3bf4e79 commit a89a5bf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion elixir-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
(or "_" "__MODULE__" "__DIR__" "__ENV__" "__CALLER__"
"__block__" "__aliases__")
symbol-end))
(sigils . ,(rx "~" (or "B" "C" "R" "S" "b" "c" "r" "s" "w")))))
(sigils . ,(rx "~" (or "B" "C" "D" "R" "S" "b" "c" "r" "s" "w")))))

(defmacro elixir-rx (&rest sexps)
(let ((rx-constituents (append elixir-rx-constituents rx-constituents)))
Expand Down
7 changes: 5 additions & 2 deletions test/elixir-mode-font-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ end"
~w<\">
~s\"\"\"
foo
\"\"\""
\"\"\"
~D(\")"
(should-not (eq (elixir-test-face-at 5) 'font-lock-string-face)) ; ~s//

(should-not (eq (elixir-test-face-at 7) 'font-lock-string-face)) ; ~r||
Expand Down Expand Up @@ -400,7 +401,9 @@ foo
(should (eq (elixir-test-face-at 51) 'font-lock-string-face)) ; ~s""" """
(should (eq (elixir-test-face-at 52) 'font-lock-string-face))
(should (eq (elixir-test-face-at 53) 'font-lock-string-face))
(should (eq (elixir-test-face-at 55) 'font-lock-string-face))))
(should (eq (elixir-test-face-at 55) 'font-lock-string-face))

(should (eq (elixir-test-face-at 66) 'font-lock-string-face)))) ; ~D()

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

0 comments on commit a89a5bf

Please sign in to comment.