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) 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