                              (?. font-lock-type-face)))
         (goto-char (match-end 0)))
 
-      ;; Highlight attr hashes and obj refs
-      (dolist (char '(?\{ ?\[))
-        (when (eq (char-after) char)
-          (let ((beg (point)))
-            (haml-limited-forward-sexp eol)
-            (haml-fontify-region-as-ruby beg (point)))))
+      ;; Highlight obj refs
+      (when (eq (char-after) ?\[)
+        (let ((beg (point)))
+          (haml-limited-forward-sexp eol)
+          (haml-fontify-region-as-ruby beg (point))))
+
+      ;; Highlight attr hashes
+      (when (eq (char-after) ?\{)
+        (let ((beg (point)))
+          (haml-limited-forward-sexp eol)
+
+          ;; Check for multiline
+          (while (and (eolp) (eq (char-before) ?,))
+            (forward-line)
+            (let ((eol (save-excursion (end-of-line) (point))))
+              ;; If no sexps are closed,
+              ;; we're still continuing a  multiline hash
+              (if (>= (car (parse-partial-sexp (point) eol)) 0)
+                  (end-of-line)
+                ;; If sexps have been closed,
+                ;; set the point at the end of the total sexp
+                (goto-char beg)
+                (haml-limited-forward-sexp eol))))
+
+          (haml-fontify-region-as-ruby beg (point))))
 
       ;; Move past end chars
       (when (looking-at "[<>&!]+") (goto-char (match-end 0)))

      (beginning-of-line)
      (unless (or (looking-at haml-filter-re)
                  (looking-at haml-comment-re))
        (return-from haml-extend-region))
      (setq font-lock-beg (point))
      (haml-forward-sexp)
      (beginning-of-line)
      (setq font-lock-end (max font-lock-end (point))))
    (or (/= old-beg font-lock-beg)
        (/= old-end font-lock-end))))



\\{haml-mode-map}"
  (set-syntax-table haml-mode-syntax-table)
  (add-to-list 'font-lock-extend-region-functions 'haml-extend-region-filters-comments)
  (add-to-list 'font-lock-extend-region-functions 'haml-extend-region-multiline-hashes)
  (set (make-local-variable 'font-lock-multiline) t)
  (set (make-local-variable 'indent-line-function) 'haml-indent-line)
  (set (make-local-variable 'indent-region-function) 'haml-indent-region)
