]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: fontify type switch correctly
authorDominik Honnef <dominik.honnef@gmail.com>
Mon, 6 Jan 2014 16:11:03 +0000 (11:11 -0500)
committerAlan Donovan <adonovan@google.com>
Mon, 6 Jan 2014 16:11:03 +0000 (11:11 -0500)
Require at least one space after "type" and do not fontify closing
parenthesis of type switch as a type.

R=adonovan
CC=golang-codereviews
https://golang.org/cl/37720050

misc/emacs/go-mode.el

index aabaa1349344c3d4a0aec32de9eb32dda595d181..6adac91ab942b03949c1644154508b9d7e18d49f 100644 (file)
@@ -264,8 +264,8 @@ For mode=set, all covered lines will have this weight."
      `((,go-func-meth-regexp 1 font-lock-function-name-face))) ;; method name
 
    `(
-     (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*\\([^[:space:]]+\\)") 1 font-lock-type-face) ;; types
-     (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]*" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types
+     (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]+\\([^[:space:]]+\\)") 1 font-lock-type-face) ;; types
+     (,(concat (go--regexp-enclose-in-symbol "type") "[[:space:]]+" go-identifier-regexp "[[:space:]]*" go-type-name-regexp) 1 font-lock-type-face) ;; types
      (,(concat "[^[:word:][:multibyte:]]\\[\\([[:digit:]]+\\|\\.\\.\\.\\)?\\]" go-type-name-regexp) 2 font-lock-type-face) ;; Arrays/slices
      (,(concat "\\(" go-identifier-regexp "\\)" "{") 1 font-lock-type-face)
      (,(concat (go--regexp-enclose-in-symbol "map") "\\[[^]]+\\]" go-type-name-regexp) 1 font-lock-type-face) ;; map value type