branch: elpa/nix-mode
commit 8118a807a7cc643686a0ba133c6b5f56ccb1b293
Author: Matthew Bauer <[email protected]>
Commit: Matthew Bauer <[email protected]>
Handle more edge cases in keywords
when a symbol comes after or before the keyword, it is still okay to
use as a keyword.
---
nix-mode.el | 4 ++--
tests/nix-font-lock-tests.el | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index b1a263465a..2e873a45e6 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -132,9 +132,9 @@ very large Nix files (all-packages.nix)."
"Produce a regexp matching some keywords of Nix.
KEYWORDS a list of strings to match as Nix keywords."
(concat
- "\\(?:[[:space:]]\\|^\\)"
+ "\\(?:[[:space:];:{}()]\\|^\\)"
(regexp-opt keywords t)
- "\\(?:[[:space:]]\\|$\\)"
+ "\\(?:[[:space:];:{}()]\\|$\\)"
))
(defconst nix-font-lock-keywords
diff --git a/tests/nix-font-lock-tests.el b/tests/nix-font-lock-tests.el
index e2fdfd457b..5abdb5744f 100644
--- a/tests/nix-font-lock-tests.el
+++ b/tests/nix-font-lock-tests.el
@@ -76,7 +76,7 @@ if all of its characters have syntax and face. See
(ert-deftest nix-issue-84 ()
(check-properties
- '("{ with-a ? { let-in = 1; } , ... }: with with-a; { foo = \"bar\"; }")
+ '("{ with-a ? {let-in=1; } , ... }:with with-a; { foo = \"bar\"; }")
'(("let-in" t nix-attribute-face)
("with" t nix-keyword-face)
("foo" t nix-attribute-face))))