From d37c454d4ae442d32e9d885310306c7eef2ceb5b Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Wed, 28 Oct 2015 15:55:46 +0900 Subject: [PATCH 1/2] Add unit test for highlighting sigil triple quote(#286) --- test/elixir-mode-font-test.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/elixir-mode-font-test.el b/test/elixir-mode-font-test.el index 5b7f2a4c..2488e6df 100644 --- a/test/elixir-mode-font-test.el +++ b/test/elixir-mode-font-test.el @@ -414,6 +414,18 @@ foo (should-not (eq (elixir-test-face-at 25) 'font-lock-string-face)) (should (eq (elixir-test-face-at 26) 'elixir-atom-face)))) +(ert-deftest elixir-mode-syntax-table/sigil-triple-quote () + "https://github.com/elixir-lang/emacs-elixir/issues/286" + :tags '(fontification syntax-table) + (elixir-test-with-temp-buffer + "defmodule IEx do + @moduledoc ~S\"\"\" + Elixir's interactive shell. +\"\"\" +end +" + (should (eq (elixir-test-face-at 33) 'font-lock-string-face)))) + (provide 'elixir-mode-font-test) ;;; elixir-mode-font-test.el ends here From a7af76255319d183b7e7f6bd8d890e0928da61e5 Mon Sep 17 00:00:00 2001 From: Syohei YOSHIDA Date: Wed, 28 Oct 2015 15:56:29 +0900 Subject: [PATCH 2/2] Fix ~S""" case --- elixir-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir-mode.el b/elixir-mode.el index 073728ba..270d0227 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -264,7 +264,7 @@ is used to limit the scan." (unless (elixir-syntax-in-string-or-comment-p) (let ((heredoc-p (save-excursion (goto-char (match-beginning 0)) - (looking-at-p "~s\"\"\"")))) + (looking-at-p "~[sS]\"\"\"")))) (unless heredoc-p (forward-char 1) (let* ((start-delim (char-after (1- (point))))