Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

implement string interpolation highlight #120

Merged
merged 1 commit into from

2 participants

@syohex
Collaborator

Related issue #6 #97 #98.
Please see this patch.

Original

coffee-mode-before

Applied this patch

coffee-mode-after

@jart jart merged commit cf96f6c into defunkt:master
@jart
Collaborator

Excellent work <3

For the record, this will highlight #{...} outside of strings, but I think that's acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @syohex
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 coffee-mode.el
View
6 coffee-mode.el
@@ -418,6 +418,9 @@ called `coffee-compiled-buffer-name'."
(defvar coffee-regexp-regexp "\\/\\(\\\\.\\|\\[\\(\\\\.\\|.\\)+?\\]\\|[^/
]\\)+?\\/")
+;; String Interpolation(This regexp is taken from ruby-mode)
+(defvar coffee-string-interpolation-regexp "#{[^}\n\\\\]*\\(?:\\\\.[^}\n\\\\]*\\)*}")
+
;; JavaScript Keywords
(defvar coffee-js-keywords
'("if" "else" "new" "return" "try" "catch"
@@ -482,7 +485,8 @@ called `coffee-compiled-buffer-name'."
(,coffee-regexp-regexp . font-lock-constant-face)
(,coffee-boolean-regexp . font-lock-constant-face)
(,coffee-class-regexp 2 'coffee-mode-class-name)
- (,coffee-keywords-regexp 1 font-lock-keyword-face)))
+ (,coffee-keywords-regexp 1 font-lock-keyword-face)
+ (,coffee-string-interpolation-regexp 0 font-lock-variable-name-face t)))
;;
;; Helper Functions
Something went wrong with that request. Please try again.