summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDominik Honnef <dominik.honnef@gmail.com>2014-01-06 11:11:03 -0500
committerDominik Honnef <dominik.honnef@gmail.com>2014-01-06 11:11:03 -0500
commit3349864819638183ff7afb571362293df9b16154 (patch)
treeb529741a15e43521a7c376c7bf2e97283a612ade /misc
parent9b86597b84e4283b1124266dc06650d02cf5b400 (diff)
downloadgo-3349864819638183ff7afb571362293df9b16154.tar.gz
misc/emacs: fontify type switch correctly
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://codereview.appspot.com/37720050 Committer: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/emacs/go-mode.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/misc/emacs/go-mode.el b/misc/emacs/go-mode.el
index aabaa1349..6adac91ab 100644
--- a/misc/emacs/go-mode.el
+++ b/misc/emacs/go-mode.el
@@ -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