Skip to content

Commit bf8bde8

Browse files
committed
Merge pull request #270 from syohex/hashmark-in-sigil
Fix highlighting hashmark in sigil
2 parents fea4caa + 886aa91 commit bf8bde8

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

elixir-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ is used to limit the scan."
278278
(when (memq start-delim '(?' ?\"))
279279
(setq end (1+ end))
280280
(forward-char -1))
281-
(while (re-search-forward "[\"']" end t)
281+
(while (re-search-forward "[\"'#]" end t)
282282
(put-text-property (1- (point)) (point) 'syntax-table word-syntax))))))
283283

284284
(defun elixir-syntax-propertize-function (start end)

test/elixir-mode-font-test.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,14 @@ foo
362362
(should (eq (elixir-test-face-at 53) 'font-lock-string-face))
363363
(should (eq (elixir-test-face-at 55) 'font-lock-string-face))))
364364

365+
(ert-deftest elixir-mode-syntax-table/hashmark-in-sigils ()
366+
"Don't treat hashmark in sigils as comment"
367+
:tags '(fontification syntax-table)
368+
(elixir-test-with-temp-buffer
369+
"~s(# foo)"
370+
(should-not (eq (elixir-test-face-at 4) 'font-lock-comment-face))
371+
(should (eq (elixir-test-face-at 6) 'font-lock-string-face))))
372+
365373
(provide 'elixir-mode-font-test)
366374

367375
;;; elixir-mode-font-test.el ends here

0 commit comments

Comments
 (0)