From b94f636b398aabf7d763b958a5db05988558a0d6 Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Fri, 16 Oct 2015 12:28:31 +0900 Subject: [PATCH 1/2] Fix highlighting hashmark in sigil --- elixir-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir-mode.el b/elixir-mode.el index 4dafc7a8..f2efae88 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -278,7 +278,7 @@ is used to limit the scan." (when (memq start-delim '(?' ?\")) (setq end (1+ end)) (forward-char -1)) - (while (re-search-forward "[\"']" end t) + (while (re-search-forward "[\"'#]" end t) (put-text-property (1- (point)) (point) 'syntax-table word-syntax)))))) (defun elixir-syntax-propertize-function (start end) From 886aa91e3ef6db95911e642aea0a7f866dab4d8f Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Fri, 16 Oct 2015 13:38:35 +0900 Subject: [PATCH 2/2] Add unit test for hashmark in sigil --- test/elixir-mode-font-test.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index 6a7f8ccc..bbc145d9 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -362,6 +362,14 @@ foo (should (eq (elixir-test-face-at 53) 'font-lock-string-face)) (should (eq (elixir-test-face-at 55) 'font-lock-string-face)))) +(ert-deftest elixir-mode-syntax-table/hashmark-in-sigils () + "Don't treat hashmark in sigils as comment" + :tags '(fontification syntax-table) + (elixir-test-with-temp-buffer + "~s(# foo)" + (should-not (eq (elixir-test-face-at 4) 'font-lock-comment-face)) + (should (eq (elixir-test-face-at 6) 'font-lock-string-face)))) + (provide 'elixir-mode-font-test) ;;; elixir-mode-font-test.el ends here