diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-27 19:57:29 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2017-09-27 19:57:29 +0200 |
commit | 8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8 (patch) | |
tree | 125734ac66307a962eeda16283355dde0d0fbd2e /after/syntax/javascript/graphql.vim | |
parent | 9bfde7574aa89a91b80ed9c993fc000cfc11aae7 (diff) | |
download | vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.tar.gz vim-polyglot-8b3418cab8eb5267b3a5743e4d5fe5f698d48bc8.zip |
Update
Diffstat (limited to 'after/syntax/javascript/graphql.vim')
-rw-r--r-- | after/syntax/javascript/graphql.vim | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/after/syntax/javascript/graphql.vim b/after/syntax/javascript/graphql.vim new file mode 100644 index 00000000..58c1de08 --- /dev/null +++ b/after/syntax/javascript/graphql.vim @@ -0,0 +1,21 @@ +if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'graphql') == -1 + +if exists('b:current_syntax') + let s:current_syntax = b:current_syntax + unlet b:current_syntax +endif +syn include @GraphQLSyntax syntax/graphql.vim +if exists('s:current_syntax') + let b:current_syntax = s:current_syntax +endif + +syntax region graphqlTemplateString start=+`+ skip=+\\\(`\|$\)+ end=+`+ contains=@GraphQLSyntax,jsTemplateExpression,jsSpecial extend +exec 'syntax match graphqlTaggedTemplate +\%(' . join(g:graphql_javascript_tags, '\|') . '\)\%(`\)\@=+ nextgroup=graphqlTemplateString' + +hi def link graphqlTemplateString jsTemplateString +hi def link graphqlTaggedTemplate jsTaggedTemplate + +syn cluster jsExpression add=graphqlTaggedTemplate +syn cluster graphqlTaggedTemplate add=graphqlTemplateString + +endif |