Permalink
Browse files

it turns out that coffee script block comments are more complicated t…

…han i thought, support more cases.
  • Loading branch information...
1 parent 40d4c46 commit 834ce208ed4c4c89dddd39cd1bcb51adba00a662 @jvshahid jvshahid committed Dec 18, 2012
Showing with 17 additions and 1 deletion.
  1. +17 −1 coffee-mode.el
View
@@ -806,13 +806,29 @@ END lie."
(beginning-of-line)
(add-text-properties (point) (+ (point) 1) `(syntax-table (14 . nil)))))
+;; support coffescript block comments
+;; examples:
+;; at indent level 0
+;; ###
+;; foobar
+;; ###
+;; at indent level 0 with text following it
+;; ### foobar
+;; moretext
+;; ###
+;; at indent level > 0
+;; ###
+;; foobar
+;; ###
+;; examples of non-block comments:
+;; #### foobar
(defun coffee-propertize-function (start end)
;; return if we don't have anything to parse
(unless (>= start end)
(save-excursion
(progn
(goto-char start)
- (let ((match (re-search-forward "^###.*$" end t)))
+ (let ((match (re-search-forward "^[[:space:]]*###\\([[:space:]]+.*\\)?$" end t)))
(if match
(progn
(coffee-block-comment-delimiter match)

0 comments on commit 834ce20

Please sign in to comment.