From 58a01820ea6dac4c918d29d68955f88a812c8009 Mon Sep 17 00:00:00 2001 From: Jonathan Arnett Date: Wed, 16 Dec 2020 22:28:23 -0500 Subject: [PATCH 1/2] Highlight atom map keys that end with a newline --- elixir-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elixir-mode.el b/elixir-mode.el index 06dc1fde..e079a84d 100644 --- a/elixir-mode.el +++ b/elixir-mode.el @@ -427,7 +427,7 @@ is used to limit the scan." 1 font-lock-variable-name-face) ;; Map keys - (,(elixir-rx (group (and identifiers ":")) space) + (,(elixir-rx (group (and identifiers ":")) (or space "\n")) 1 elixir-atom-face) ;; Pseudovariables From ad147990e6242224ab3b8731f6cf1d54b0c490b4 Mon Sep 17 00:00:00 2001 From: Jonathan Arnett Date: Wed, 24 Mar 2021 12:00:48 -0400 Subject: [PATCH 2/2] Add test for map key fontification with value on subsequent line --- tests/elixir-mode-font-test.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/elixir-mode-font-test.el b/tests/elixir-mode-font-test.el index 1ca470e8..1306b3f7 100644 --- a/tests/elixir-mode-font-test.el +++ b/tests/elixir-mode-font-test.el @@ -250,7 +250,12 @@ true_false_nil ;; https://github.com/elixir-editors/emacs-elixir/issues/320 (elixir-test-with-temp-buffer "<>" - (should-not (eq (elixir-test-face-at 3) 'elixir-atom-face)))) + (should-not (eq (elixir-test-face-at 3) 'elixir-atom-face))) + + (elixir-test-with-temp-buffer + "%{key: + a_very_long_value_that_needed_to_wrap}" + (should (eq (elixir-test-face-at 3) 'elixir-atom-face)))) (ert-deftest elixir-mode-syntax-table/fontify-interpolation () :tags '(fontification interpolation syntax-table)