Skip to content

Only set 'syn-sync' when we're the main syntax #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions syntax/graphql.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
" Language: GraphQL
" Maintainer: Jon Parise <[email protected]>

if exists('b:current_syntax')
if !exists('main_syntax')
if exists('b:current_syntax')
finish
endif
let main_syntax = 'graphql'
elseif exists('b:current_syntax') && b:current_syntax ==# 'graphql'
finish
endif

Expand Down Expand Up @@ -90,6 +95,11 @@ hi def link graphqlStructure Structure
hi def link graphqlType Type
hi def link graphqlVariable Identifier

syn sync minlines=500
if main_syntax ==# 'graphql'
syn sync minlines=500
endif

let b:current_syntax = 'graphql'
if main_syntax ==# 'graphql'
unlet main_syntax
endif