Skip to content

Commit

Permalink
Merge pull request #272 from gausby/add-send-and-send-after-to-font-lock
Browse files Browse the repository at this point in the history
Added `send` and `send_after` to font lock
  • Loading branch information
tonini committed Oct 21, 2015
2 parents eac04b1 + ced2cf6 commit 577c98c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion elixir-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
symbol-start
(or "case" "cond" "for" "if" "unless" "try" "receive"
"raise" "quote" "unquote" "unquote_splicing" "throw"
"super")
"super" "send" "send_after")
symbol-end))
(builtin-declaration . ,(rx (or line-start (not (any ".")))
symbol-start
Expand Down
14 changes: 14 additions & 0 deletions test/elixir-mode-font-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ when"
(should-not (eq (elixir-test-face-at 67) 'font-lock-keyword-face))
(should (eq (elixir-test-face-at 72) 'font-lock-keyword-face))))

(ert-deftest elixir-mode-syntax-table/highlight-send-and-send-after ()
"Highlight both send and send_after as keywords"
:tags '(fontification syntax-table)
(elixir-test-with-temp-buffer
"defmodule Foo do
def bar(pid) do
send pid, :baz
send_after pid, :baz, 5000
end
end"
(should (eq (elixir-test-face-at 40) 'font-lock-keyword-face))
(should (eq (elixir-test-face-at 60) 'font-lock-keyword-face))
(should (eq (elixir-test-face-at 65) 'font-lock-keyword-face))))

(ert-deftest elixir-mode-syntax-table/string-interpolation-in-words-list ()
"https://github.com/elixir-lang/emacs-elixir/issues/263"
:tags '(fontification syntax-table)
Expand Down

0 comments on commit 577c98c

Please sign in to comment.