diff --git a/elixir-mode.el b/elixir-mode.el index a53d2273..7a065e11 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -387,7 +387,7 @@ '("\\(\\w+\\)\\s-*:?=[^=]" 1 font-lock-variable-name-face) ;; regexes: - '("-[Rr].*[ \n\t]" . font-lock-constant-face) + '("~r/\\(.*\\)/[, \n\t]*" 1 font-lock-string-face) ;; atoms, boolean: '("\\<\\(true\\|false\\|nil\\)\\>" . font-lock-reference-face) diff --git a/test/elixir-mode-font-tests.el b/test/elixir-mode-font-tests.el index f9a985e0..5d781461 100644 --- a/test/elixir-mode-font-tests.el +++ b/test/elixir-mode-font-tests.el @@ -27,7 +27,10 @@ buffer." (elixir-test-with-temp-buffer "match = ~r/foo/" (should (eq (elixir-test-face-at 1) 'font-lock-variable-name-face)) - (should (eq (elixir-test-face-at 9) 'font-lock-builtin-face)))) + (should (eq (elixir-test-face-at 9) 'font-lock-builtin-face)) + (should (eq (elixir-test-face-at 12) 'font-lock-string-face)) + ;; no face for regex delimiters + (should (eq (elixir-test-face-at 15) nil)))) (ert-deftest elixir-mode-syntax-table/fontify-modules-and-types () :tags '(fontification syntax-table)