branch: elpa/jade-mode
commit dfeadc97a561662f01f65103e62c6fdcd9315e65
Merge: 33bad1d74e 00c789673f
Author: Brian C <[email protected]>
Commit: Brian C <[email protected]>
Merge pull request #31 from tjefferson08/26_comment_highlight
Closes #26. Fix inline '//' highlight as comment
---
example.jade | 8 ++------
jade-mode.el | 6 +++---
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/example.jade b/example.jade
index 1a11995841..7ed94916d7 100644
--- a/example.jade
+++ b/example.jade
@@ -10,6 +10,8 @@ html(lang="en")
ul#nav_list something sweet
li
#content
+ // here is a real comment
+ a(href = 'http://www.google.com') http://www.google.com
- if (youAreUsingJade)
p You are amazing
- else
@@ -18,10 +20,4 @@ html(lang="en")
input(type: "text", name='user[name]', readonly: true, disabled)
#footer
#copywrite-text= locals
-
-
-
-
-
-
diff --git a/jade-mode.el b/jade-mode.el
index ced95499c3..f39c961fe9 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -50,13 +50,12 @@ For detail, see `comment-dwim'."
(,"#\\(\\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
+ (,"^[ {2,}]*[a-z0-9_:\\-]*" 0 font-lock-function-name-face) ;; tag name
+ (,"^\\s-*//.*" 0 font-lock-comment-face t))) ;; jade block comments
;; syntax 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'.")
@@ -89,6 +88,7 @@ For detail, see `comment-dwim'."
;; comment syntax
(set (make-local-variable 'comment-start) "// ")
+ (set (make-local-variable 'comment-start-skip) "//\\s-*")
;; default tab width
(setq sws-tab-width 2)