diff --git a/elixir-smie.el b/elixir-smie.el index a084e525..8935399c 100644 --- a/elixir-smie.el +++ b/elixir-smie.el @@ -78,6 +78,7 @@ ;; Note that ?_ might be better as class "_", but either seems to ;; work: + (modify-syntax-entry ?| "." table) (modify-syntax-entry ?_ "_" table) (modify-syntax-entry ?? "w" table) (modify-syntax-entry ?~ "w" table) diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index bbc145d9..4002662e 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -370,6 +370,17 @@ foo (should-not (eq (elixir-test-face-at 4) 'font-lock-comment-face)) (should (eq (elixir-test-face-at 6) 'font-lock-string-face)))) +(ert-deftest elixir-mode-syntax-table/highlight-modules-after-pipe () + "Module names must be hightligthed if preceded by a pipe character." + (elixir-test-with-temp-buffer + "|List" + (should-not (eq (elixir-test-face-at 1) 'font-lock-type-face)) + (should (eq (elixir-test-face-at 3) 'font-lock-type-face))) + (elixir-test-with-temp-buffer + "[req_code(op_name)|Enum.reverse(data)]" + (should-not (eq (elixir-test-face-at 19) 'font-lock-type-face)) + (should (eq (elixir-test-face-at 21) 'font-lock-type-face)))) + (provide 'elixir-mode-font-test) ;;; elixir-mode-font-test.el ends here