branch: elpa/nix-mode
commit 1268096ba703268a3098ea10fa854b45a04dd2dd
Merge: 5e943a77e8 de02e17924
Author: Matthew Justin Bauer <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #27 from ljli/close-open-fix
Fix fontification of "}${" in some contexts
---
nix-mode.el | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index b99b2efafd..282078abbf 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -180,16 +180,18 @@
(defun nix--antiquote-close-open ()
(let* ((start (match-beginning 0))
- (ps (nix--get-parse-state start)))
- (when (and (not (nix--get-string-type ps))
- (nix--open-brace-antiquote-p ps))
- (let ((string-type (nix--open-brace-string-type ps)))
- (put-text-property start (+ 3 start)
- 'nix-string-type string-type)
- (put-text-property start (1+ start)
- 'nix-syntax-antiquote t)
- (put-text-property (+ 2 start) (+ 3 start)
- 'nix-syntax-antiquote t)))))
+ (ps (nix--get-parse-state start))
+ (string-type (nix--get-string-type ps)))
+ (if string-type
+ (nix--antiquote-open-at (1+ start) string-type)
+ (when (nix--open-brace-antiquote-p ps)
+ (let ((string-type (nix--open-brace-string-type ps)))
+ (put-text-property start (+ 3 start)
+ 'nix-string-type string-type)
+ (put-text-property start (1+ start)
+ 'nix-syntax-antiquote t)
+ (put-text-property (+ 2 start) (+ 3 start)
+ 'nix-syntax-antiquote t))))))
(defun nix--antiquote-close ()
(let* ((start (match-beginning 0))