emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/nix-mode 8d2a304865 098/500: Fontification: smoked out cor


From: ELPA Syncer
Subject: [nongnu] elpa/nix-mode 8d2a304865 098/500: Fontification: smoked out corner cases
Date: Sat, 29 Jan 2022 08:26:40 -0500 (EST)

branch: elpa/nix-mode
commit 8d2a3048656b188a85177faecbcef818617a5fd8
Author: Leon Isenberg <ljli@users.noreply.github.com>
Commit: Leon Isenberg <ljli@users.noreply.github.com>

    Fontification: smoked out corner cases
---
 nix-mode.el | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/nix-mode.el b/nix-mode.el
index 425060b517..4852566444 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -174,10 +174,21 @@
                              'nix-syntax-antiquote t)
           (let ((ahead (buffer-substring (1+ start) (min (point-max) (+ 5 
start)))))
             (case string-type
-              (?\" (unless (string-match-p "^\"" ahead)
+              (?\" (cond
+                    ((string-match-p "^\\\\\"" ahead)
                      (put-text-property (1+ start) (+ 2 start)
-                                        'syntax-table (string-to-syntax "|")))
-                   (goto-char (+ 2 start)))
+                                        'syntax-table (string-to-syntax "|"))
+                     (goto-char (+ 3 start)))
+                    ((string-match-p "^\\\\\\${" ahead)
+                     (put-text-property (1+ start) (+ 2 start)
+                                        'syntax-table (string-to-syntax "|"))
+                     (goto-char (+ 4 start)))
+                    ((string-match-p "^\"" ahead)
+                     (goto-char (+ 2 start)))
+                    (t
+                     (put-text-property (1+ start) (+ 2 start)
+                                        'syntax-table (string-to-syntax "|"))
+                     (goto-char (+ 2 start)))))
               (?\' (cond
                     ((string-match-p "^'''" ahead)
                      (put-text-property (1+ start) (+ 2 start)
@@ -187,7 +198,7 @@
                      (put-text-property (1+ start) (+ 2 start)
                                         'syntax-table (string-to-syntax "|"))
                      (goto-char (+ 5 start)))
-                    ((string-match-p "^''\\[nrt]" ahead)
+                    ((string-match-p "^''\\\\[nrt]" ahead)
                      (put-text-property (1+ start) (+ 2 start)
                                         'syntax-table (string-to-syntax "|"))
                      (goto-char (+ 5 start)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]