diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-04 16:29:56 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2019-09-04 16:29:56 +0200 |
commit | 556c56d185fcc7d5cc6d51ea9a6453bcd4f7116c (patch) | |
tree | f97d9f0cdf9df718aaf1a04eed16819a84a5bab2 /after/autoload/styledcomplete.vim | |
parent | fe84062992e12dea8e090e647afa6b314e891f73 (diff) | |
download | vim-polyglot-556c56d185fcc7d5cc6d51ea9a6453bcd4f7116c.tar.gz vim-polyglot-556c56d185fcc7d5cc6d51ea9a6453bcd4f7116c.zip |
Add graphql support, closes #298
Diffstat (limited to 'after/autoload/styledcomplete.vim')
-rw-r--r-- | after/autoload/styledcomplete.vim | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/after/autoload/styledcomplete.vim b/after/autoload/styledcomplete.vim index efa992c4..d1a8859d 100644 --- a/after/autoload/styledcomplete.vim +++ b/after/autoload/styledcomplete.vim @@ -19,3 +19,45 @@ fun! styledcomplete#CompleteSC(findstart, base) return s:funcref(a:findstart, a:base) endif endfun +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1 + finish +endif + +" Vim completion script +" Language: styled-components (js/ts) +" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com> +" URL: https://github.com/styled-components/vim-styled-components + +fun! styledcomplete#CompleteSC(findstart, base) + if IsStyledDefinition(line('.')) + return csscomplete#CompleteCSS(a:findstart, a:base) + endif + + " Only trigger original omnifunc if it was set in the first place + if exists('b:prevofu') + " create a funcref to call with the previous omnicomplete function + let s:funcref = function(b:prevofu) + return s:funcref(a:findstart, a:base) + endif +endfun +if exists('g:polyglot_disabled') && index(g:polyglot_disabled, 'styled-components') != -1 + finish +endif + +" Vim completion script +" Language: styled-components (js/ts) +" Maintainer: Karl Fleischmann <fleischmann.karl@gmail.com> +" URL: https://github.com/styled-components/vim-styled-components + +fun! styledcomplete#CompleteSC(findstart, base) + if IsStyledDefinition(line('.')) + return csscomplete#CompleteCSS(a:findstart, a:base) + endif + + " Only trigger original omnifunc if it was set in the first place + if exists('b:prevofu') + " create a funcref to call with the previous omnicomplete function + let s:funcref = function(b:prevofu) + return s:funcref(a:findstart, a:base) + endif +endfun |