[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode 9b705381c4 063/500: Fix antiquote highlighting.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode 9b705381c4 063/500: Fix antiquote highlighting. |
Date: |
Sat, 29 Jan 2022 08:26:36 -0500 (EST) |
branch: elpa/nix-mode
commit 9b705381c40ef1ac28a929b7019659f3d996494a
Author: Matthew Bauer <mjbauer95@gmail.com>
Commit: Matthew Bauer <mjbauer95@gmail.com>
Fix antiquote highlighting.
Fixes #3.
---
nix-mode.el | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index 9b2576a2c6..966ce793ff 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -107,11 +107,16 @@
(defun nix-syntax-propertize-antiquote ()
"Set syntax properties for an antiquote mark."
- (let* ((start (match-beginning 0)))
- (put-text-property start (1+ start)
- 'syntax-table (string-to-syntax "|"))
- (put-text-property start (+ start 2)
- 'nix-syntax-antiquote t)))
+ (let* ((start (match-beginning 0))
+ (context (save-excursion (save-match-data (syntax-ppss start))))
+ (string-type (nth 3 context)))
+
+ ;; only add antiquote when we're already in a string
+ (when string-type
+ (put-text-property start (1+ start)
+ 'syntax-table (string-to-syntax "|"))
+ (put-text-property start (+ start 2)
+ 'nix-syntax-antiquote t))))
(defun nix-syntax-propertize-close-brace ()
"Set syntax properties for close braces.
- [nongnu] elpa/nix-mode 8b3a9927e7 270/500: Add dependency on json-mode, (continued)
- [nongnu] elpa/nix-mode 8b3a9927e7 270/500: Add dependency on json-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7a7f600133 288/500: travis: Add travis badge, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode da16900326 293/500: tests: Add a testcase with broken identation to have as a check if it indents at all, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa43b72a45 014/500: Revert "Use warning font lock for upper case vars", ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a2674592f 033/500: Don't save-excursion for nix-indent-line., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 233bf03b96 040/500: Add nixfmt command., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff550f9bbd 036/500: Add comments., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ea95e3c9c6 068/500: Add nix-prettify-mode.el., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6eaf2a97d2 069/500: Fixup hanging indent., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e53d99d840 064/500: Ignore '* chars in syntax propertize., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9b705381c4 063/500: Fix antiquote highlighting.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 0624820fd3 067/500: Fix org-mode fontification error., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 3338f5997e 056/500: Fix beginning of buffer issue, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 0f01eecdaa 050/500: Make sure everything starts at beginning of line., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 03f462ef34 062/500: Add "+" to hanging indent list., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ad09b3be7f 066/500: Fix flycheck errors., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6534f146eb 065/500: Formatting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5a29112764 073/500: Add function for escaped antiquote., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 460cc23161 075/500: Make " be treated as generic | syntax class., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode ff8409c617 079/500: Declare lexical-binding, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 6a9cb7e682 081/500: Add basic REPL via nix-repl, ELPA Syncer, 2022/01/29