This commit is contained in:
Adam Stankiewicz
2019-09-04 16:50:13 +02:00
parent 556c56d185
commit 31d757fc7b

View File

@@ -61,3 +61,24 @@ 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