[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes. |
Date: |
Sat, 29 Jan 2022 08:26:42 -0500 (EST) |
branch: elpa/nix-mode
commit 3e6fdd8311104e9a8ae77ae82437071392c4c86a
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Add back syntax coloring of antiquotes.
Fixes issue #20.
---
nix-mode.el | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/nix-mode.el b/nix-mode.el
index 2fa86c44b2..a9b8337297 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -26,6 +26,25 @@
;;; Syntax coloring
+(defun nix-syntax-match-antiquote (limit)
+ "Find antiquote within a Nix expression up to LIMIT."
+ (let ((pos (next-single-char-property-change (point) 'nix-syntax-antiquote
+ nil limit)))
+ (when (and pos (> pos (point)) (< pos (point-max)))
+ (goto-char pos)
+ (let ((char (char-after pos)))
+ (pcase char
+ (`?{
+ (forward-char 1)
+ (set-match-data (list (1- pos) (point)))
+ t)
+ (`?}
+ (forward-char 1)
+ (set-match-data (list pos (point)))
+ t))
+ )
+ )))
+
(defconst nix-keywords
'("if" "then"
"else" "with"
@@ -65,7 +84,9 @@
(,nix-re-url . font-lock-constant-face)
(,nix-re-file-path . font-lock-constant-face)
(,nix-re-variable-assign 1 font-lock-variable-name-face)
- (,nix-re-bracket-path . font-lock-constant-face))
+ (,nix-re-bracket-path . font-lock-constant-face)
+ (nix-syntax-match-antiquote 0 font-lock-preprocessor-face t)
+ )
"Font lock keywords for nix.")
(makunbound 'nix-mode-syntax-table)
- [nongnu] elpa/nix-mode 70af0efc9f 076/500: Fix antiquote closing brace., (continued)
- [nongnu] elpa/nix-mode 70af0efc9f 076/500: Fix antiquote closing brace., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 59e9ca0abd 084/500: Improve fontification, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 68793d91c5 107/500: Add require 'cl for case statements., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2221a09aea 108/500: Require 'cl for "case"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e4bc711d81 094/500: Add some more modes., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e1f2e24cc4 104/500: Move separate modes into own files., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 56a87c8d81 087/500: Move nix-flycheck to separate file., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 199e20413e 102/500: Ignore comments for hanging let's., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode fcbaf3e054 106/500: Rename flycheck mode to "nix-flycheck"., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 542ae77358 110/500: buffer-substring can't bet <1., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3e6fdd8311 112/500: Add back syntax coloring of antiquotes.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 66cc5478de 113/500: Merge branch 'master' into separate-files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0fd152e118 119/500: Merge pull request #22 from ljli/various, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 04a268a6fe 126/500: Remove "let" handling of indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1a4c98fcf7 118/500: Cosmetics, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 23bdbdf21f 124/500: Add custom mmm-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e413069e02 130/500: Fixup some corner cases in indentation, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 2def0ccd6a 191/500: Add autoload for company-nix command, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 895f9d14e5 193/500: Flatten "unless" form with no body, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 4a5b6d5d2c 177/500: Add travis and Makefile, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode af35742d55 198/500: Merge pull request #39 from purcell/master, ELPA Syncer, 2022/01/29