summaryrefslogtreecommitdiffstats
path: root/syntax/go.vim
diff options
context:
space:
mode:
Diffstat (limited to 'syntax/go.vim')
-rw-r--r--syntax/go.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/syntax/go.vim b/syntax/go.vim
index 38a4993c..fef0e689 100644
--- a/syntax/go.vim
+++ b/syntax/go.vim
@@ -395,6 +395,24 @@ function! s:hi()
hi def link goDiagnosticError SpellBad
hi def link goDiagnosticWarning SpellRare
+ " TODO(bc): is it appropriate to define text properties in a syntax file?
+ " The highlight groups need to be defined before the text properties types
+ " are added, and when users have syntax enabled in their vimrc after
+ " filetype plugin on, the highlight groups won't be defined when
+ " ftplugin/go.vim is executed when the first go file is opened.
+ " See https://github.com/fatih/vim-go/issues/2658.
+ if exists('*prop_type_add')
+ if empty(prop_type_get('goSameId'))
+ call prop_type_add('goSameId', {'highlight': 'goSameId'})
+ endif
+ if empty(prop_type_get('goDiagnosticError'))
+ call prop_type_add('goDiagnosticError', {'highlight': 'goDiagnosticError'})
+ endif
+ if empty(prop_type_get('goDiagnosticWarning'))
+ call prop_type_add('goDiagnosticWarning', {'highlight': 'goDiagnosticWarning'})
+ endif
+ endif
+
hi def link goDeclsFzfKeyword Keyword
hi def link goDeclsFzfFunction Function
hi def link goDeclsFzfSpecialComment SpecialComment