Mercurial > vim
comparison runtime/syntax/go.vim @ 34906:cb75f6489b63
runtime(go): fix highlighting import string followed by some comment (#14538)
Commit: https://github.com/vim/vim/commit/122d068585686babd63f0b729759ec269171d464
Author: Linda_pp <rhysd@users.noreply.github.com>
Date: Sun Apr 14 00:56:17 2024 +0900
runtime(go): fix highlighting import string followed by some comment (https://github.com/vim/vim/issues/14538)
Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 13 Apr 2024 18:00:07 +0200 |
parents | deee52c162df |
children |
comparison
equal
deleted
inserted
replaced
34905:78b45ac7f141 | 34906:cb75f6489b63 |
---|---|
3 " license that can be found in the LICENSE file. | 3 " license that can be found in the LICENSE file. |
4 " | 4 " |
5 " go.vim: Vim syntax file for Go. | 5 " go.vim: Vim syntax file for Go. |
6 " Language: Go | 6 " Language: Go |
7 " Maintainer: Billie Cleek <bhcleek@gmail.com> | 7 " Maintainer: Billie Cleek <bhcleek@gmail.com> |
8 " Latest Revision: 2024-03-17 | 8 " Latest Revision: 2024-04-13 |
9 " 2024-03-17: - fix goPackageComment highlight (by Vim Project) | 9 " 2024-03-17: - fix goPackageComment highlight (by Vim Project) |
10 " License: BSD-style. See LICENSE file in source repository. | 10 " License: BSD-style. See LICENSE file in source repository. |
11 " Repository: https://github.com/fatih/vim-go | 11 " Repository: https://github.com/fatih/vim-go |
12 | 12 |
13 " Quit when a (custom) syntax file was already loaded | 13 " Quit when a (custom) syntax file was already loaded |
189 else | 189 else |
190 syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup | 190 syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup |
191 syn region goRawString start=+`+ end=+`+ | 191 syn region goRawString start=+`+ end=+`+ |
192 endif | 192 endif |
193 | 193 |
194 syn match goImportString /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"$/ contained containedin=goImport | 194 syn match goImportString /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"/ contained containedin=goImport |
195 | 195 |
196 if s:HighlightFormatStrings() | 196 if s:HighlightFormatStrings() |
197 " [n] notation is valid for specifying explicit argument indexes | 197 " [n] notation is valid for specifying explicit argument indexes |
198 " 1. Match a literal % not preceded by a %. | 198 " 1. Match a literal % not preceded by a %. |
199 " 2. Match any number of -, #, 0, space, or + | 199 " 2. Match any number of -, #, 0, space, or + |