branch: elpa/jade-mode
commit 7f63cc296c44524a32daafbabc9d5280aed28f33
Merge: 275ab149ed 0de371694a
Author: Brian C <[email protected]>
Commit: Brian C <[email protected]>
Merge pull request #14 from jkpl/master
Fix unindented tags not getting highlighted
---
jade-mode.el | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/jade-mode.el b/jade-mode.el
index 189dff21df..f71c333d53 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -43,24 +43,22 @@ For detail, see `comment-dwim'."
"include" "yield" "mixin") 'words))
"Jade keywords.")
-(setq jade-font-lock-keywords
- `((,"!!!\\|doctype\\( ?[A-Za-z0-9\-\_]*\\)?" 0 font-lock-comment-face)
;; doctype
- (,jade-keywords . font-lock-keyword-face) ;; keywords
- (,"#\\(\\w\\|_\\|-\\)*" . font-lock-variable-name-face) ;; id
- (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(#[A-Za-z0-9\-\_]*[^
]\\)" 1 font-lock-variable-name-face) ;; id
- (,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)"
1 font-lock-type-face) ;; class name
- (,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-function-name-face))) ;; tag
name
+(defvar jade-font-lock-keywords
+ `((,"!!!\\|doctype\\( ?[A-Za-z0-9\-\_]*\\)?" 0 font-lock-comment-face) ;;
doctype
+ (,jade-keywords . font-lock-keyword-face) ;; keywords
+ (,"#\\(\\w\\|_\\|-\\)*" . font-lock-variable-name-face) ;; id
+ (,"\\(?:^[ {2,}]*\\(?:[a-z0-9_:\\-]*\\)\\)?\\(#[A-Za-z0-9\-\_]*[^ ]\\)" 1
font-lock-variable-name-face) ;; id
+ (,"\\(?:^[ {2,}]*\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)" 1
font-lock-type-face) ;; class name
+ (,"^[ {2,}]*[a-z0-9_:\\-]*" 0 font-lock-function-name-face))) ;; tag name
;; syntax table
-(defvar jade-syntax-table nil "Syntax table for `jade-mode'.")
-(setq jade-syntax-table
- (let ((syn-table (make-syntax-table)))
-
- (modify-syntax-entry ?\/ ". 12b" syn-table)
- (modify-syntax-entry ?\n "> b" syn-table)
- (modify-syntax-entry ?' "\"" syn-table)
-
- syn-table))
+(defvar jade-syntax-table
+ (let ((syn-table (make-syntax-table)))
+ (modify-syntax-entry ?\/ ". 12b" syn-table)
+ (modify-syntax-entry ?\n "> b" syn-table)
+ (modify-syntax-entry ?' "\"" syn-table)
+ syn-table)
+ "Syntax table for `jade-mode'.")
(defun jade-region-for-sexp ()
"Selects the current sexp as the region"