]> code.delx.au - gnu-emacs-elpa/blobdiff - context-coloring.el
Support comma splicing.
[gnu-emacs-elpa] / context-coloring.el
index 61f5a31a63571e0db6e814d05858ebb39e015c75..61c41635efc3bf18cdb79a2ba0298bbb3124ecaa 100644 (file)
@@ -330,6 +330,7 @@ generated by `js2-mode'."
 (defconst context-coloring-APOSTROPHE-CHAR (string-to-char "'"))
 (defconst context-coloring-OPEN-PARENTHESIS-CHAR (string-to-char "("))
 (defconst context-coloring-COMMA-CHAR (string-to-char ","))
+(defconst context-coloring-AT-CHAR (string-to-char "@"))
 (defconst context-coloring-BACKTICK-CHAR (string-to-char "`"))
 
 (defvar context-coloring-elisp-scope-stack '())
@@ -608,6 +609,9 @@ generated by `js2-mode'."
         (setq char (char-after))
         (when (= char context-coloring-COMMA-CHAR)
           (forward-char)
+          (when (= (char-after) context-coloring-AT-CHAR)
+            ;; If we don't do this "@" could be interpreted as a symbol.
+            (forward-char))
           (context-coloring-forward-sws)
           (context-coloring-elisp-colorize-sexp)))))))