branch: elpa/nix-mode
commit 8d2a3048656b188a85177faecbcef818617a5fd8
Author: Leon Isenberg <[email protected]>
Commit: Leon Isenberg <[email protected]>
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)))