[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/web-mode a7f75a8011 2/2: new color web-mode-interpolate-co
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/web-mode a7f75a8011 2/2: new color web-mode-interpolate-color4-face |
Date: |
Wed, 12 Oct 2022 03:59:30 -0400 (EDT) |
branch: elpa/web-mode
commit a7f75a8011254982f8624e3b3a8f8adc65ea4ef1
Author: fxbois <fxbois@gmail.com>
Commit: fxbois <fxbois@gmail.com>
new color web-mode-interpolate-color4-face
---
web-mode.el | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
diff --git a/web-mode.el b/web-mode.el
index 222efde720..8b578b1537 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -638,6 +638,11 @@ See web-mode-block-face."
"Face for element interpolation strings."
:group 'web-mode-faces)
+(defface web-mode-interpolate-color4-face
+ '((t :inherit web-mode-string-face))
+ "Face for element interpolation strings."
+ :group 'web-mode-faces)
+
(defface web-mode-css-string-face
'((t :inherit web-mode-string-face))
"Face for css strings."
@@ -7306,13 +7311,8 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
(defun web-mode-interpolate-javascript-literal (beg end)
(save-excursion
- (goto-char (1+ beg))
(setq end (1- end))
- (while (re-search-forward "${.*?}" end t)
- (put-text-property (match-beginning 0) (match-end 0)
- 'font-lock-face
- 'web-mode-variable-name-face)
- )
+ (goto-char (1+ beg))
(cond
((web-mode-looking-back "\\(css\\|styled[[:alnum:].]+\\|css = \\)" beg)
(goto-char (1+ beg))
@@ -7344,8 +7344,20 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
) ;t
) ;cond
) ;while
+ (goto-char (1+ beg))
+ (while (re-search-forward
"<\\(script\\|style\\)>\\(.*\\)</\\(script\\|style\\)>" end t)
+ (put-text-property (match-beginning 2) (match-end 2)
+ 'font-lock-face
+ 'web-mode-interpolate-color4-face)
+ )
) ;case html
) ;cond type of literal
+ (goto-char (1+ beg))
+ (while (re-search-forward "${.*?}" end t)
+ (put-text-property (match-beginning 0) (match-end 0)
+ 'font-lock-face
+ 'web-mode-variable-name-face)
+ ) ;while
))
;; todo : parsing plus compliqué: {$obj->values[3]->name}