From 1012fae065fbda7a7dad6b0a2158c801f613a953 Mon Sep 17 00:00:00 2001 From: Martin Chaine Date: Sat, 22 Oct 2016 20:02:22 +0200 Subject: [PATCH 1/3] Add missing Go keyword Add `var` to the keywords, per https://golang.org/ref/spec#Keywords. --- rc/base/go.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/base/go.kak b/rc/base/go.kak index c4b20791..13a1be91 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -30,7 +30,7 @@ addhl -group /go/code regex %{-?([0-9]*\.(?!0[xX]))?\b([0-9]+|0[xX][0-9a-fA-F]+) # Grammar keywords="break|default|defer|else|fallthrough|for|func|go|goto|if|import" keywords="${keywords}|interface|make|new|package|range|return|select|case|switch|type|continue" - attributes="const" + attributes="var|const" types="bool|byte|chan|complex128|complex64|float32|float64|int|int16|int32" types="${types}|int64|int8|interface|intptr|map|rune|string|struct|uint|uint16|uint32|uint64|uint8" values="false|true|nil" From 2f86038abe153205ab7ae9b283a6131dcc30f251 Mon Sep 17 00:00:00 2001 From: Martin Chaine Date: Sun, 23 Oct 2016 11:16:04 +0200 Subject: [PATCH 2/3] const and var are keywords not attributes --- rc/base/go.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/base/go.kak b/rc/base/go.kak index 13a1be91..acb32ccd 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -30,7 +30,7 @@ addhl -group /go/code regex %{-?([0-9]*\.(?!0[xX]))?\b([0-9]+|0[xX][0-9a-fA-F]+) # Grammar keywords="break|default|defer|else|fallthrough|for|func|go|goto|if|import" keywords="${keywords}|interface|make|new|package|range|return|select|case|switch|type|continue" - attributes="var|const" + keywords="${keywords}|var|const" types="bool|byte|chan|complex128|complex64|float32|float64|int|int16|int32" types="${types}|int64|int8|interface|intptr|map|rune|string|struct|uint|uint16|uint32|uint64|uint8" values="false|true|nil" From 93c2943ff9ca19d9067e718d352308d5d6a05a50 Mon Sep 17 00:00:00 2001 From: Martin Chaine Date: Sun, 23 Oct 2016 11:55:32 +0200 Subject: [PATCH 3/3] different highlight for variable declaration --- rc/base/go.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/base/go.kak b/rc/base/go.kak index acb32ccd..bb0955ea 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -30,7 +30,7 @@ addhl -group /go/code regex %{-?([0-9]*\.(?!0[xX]))?\b([0-9]+|0[xX][0-9a-fA-F]+) # Grammar keywords="break|default|defer|else|fallthrough|for|func|go|goto|if|import" keywords="${keywords}|interface|make|new|package|range|return|select|case|switch|type|continue" - keywords="${keywords}|var|const" + attributes="const|var" types="bool|byte|chan|complex128|complex64|float32|float64|int|int16|int32" types="${types}|int64|int8|interface|intptr|map|rune|string|struct|uint|uint16|uint32|uint64|uint8" values="false|true|nil"