]> git.ipfire.org Git - thirdparty/vim.git/commit
runtime(go): `goPackageComment` highlighting too broad
authorMatthew Hughes <matthewhughes934@gmail.com>
Sun, 17 Mar 2024 19:05:23 +0000 (20:05 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 17 Mar 2024 19:05:43 +0000 (20:05 +0100)
commit3d46de703cf645032fa4dbcd71259176db1b46b7
tree62e296ac208db1084d2f44103ecac9c29f3448fb
parentdeb2204bffa075ed5485415fc2dbd20e75d87ea4
runtime(go): `goPackageComment` highlighting too broad

Previously this would highlight any comment before a line starting
`package`, for example

    var (
      // This comment would be highlighted as a goPackageComment
      packages []string
    )

The package clause is only valid when followed by a space[1], so include
this restriction

This is upstreaming a change from `go-vim`[2]

[1] https://go.dev/ref/spec#Package_clause
[2] https://github.com/fatih/vim-go/commit/d1c36cc4173093d0be78fd826978a024febe6233

Signed-off-by: Matthew Hughes <matthewhughes934@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/go.vim