Skip to content

Commit

Permalink
Explicitly name misc filters in regexp to avoid font-locking clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
purcell committed Nov 23, 2012
1 parent 8a28d44 commit 4166611
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions haml-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ The line containing RE is matched, as well as all lines indented beneath it."
(concat "^\\([ \t]*\\)\\(" re "\\)\\([ \t]*\\(?:\n\\1 +[^\n]*\\)*\n?\\)"))

(defconst haml-font-lock-keywords
`(haml-highlight-ruby-tag
haml-highlight-ruby-script
`((haml-highlight-ruby-tag 1 font-lock-preprocessor-face)
(haml-highlight-ruby-script 1 font-lock-preprocessor-face)
haml-highlight-ruby-filter-block
haml-highlight-css-filter-block
haml-highlight-textile-filter-block
Expand Down Expand Up @@ -175,7 +175,12 @@ The fontification is done by passing the remaining args to

(defun haml-highlight-misc-filter-block (limit)
"If a misc :filter (e.g. :plain) is found within LIMIT, highlight it."
(haml-handle-filter "\\\w+" limit
(haml-handle-filter
(eval-when-compile
(regexp-opt
(mapcar 'symbol-name
'(cdata coffee erb escaped less maruku plain preserve sass scss))))
limit
(lambda (beg end)
(put-text-property beg end 'font-lock-face 'font-lock-string-face))))

Expand Down

0 comments on commit 4166611

Please sign in to comment.