summaryrefslogtreecommitdiffstats
path: root/after/autoload/styledcomplete.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2019-09-04 16:24:55 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2019-09-04 16:25:08 +0200
commitfe84062992e12dea8e090e647afa6b314e891f73 (patch)
treeca79f486b6fa9c7562dce7c0bdfef93f3cebd1f7 /after/autoload/styledcomplete.vim
parent8742443e694c51fd80db6828f3f0289183e96a40 (diff)
downloadvim-polyglot-fe84062992e12dea8e090e647afa6b314e891f73.tar.gz
vim-polyglot-fe84062992e12dea8e090e647afa6b314e891f73.zip
Include missing file from styledcomponents, fixes #418
Diffstat (limited to 'after/autoload/styledcomplete.vim')
-rw-r--r--after/autoload/styledcomplete.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/after/autoload/styledcomplete.vim b/after/autoload/styledcomplete.vim
new file mode 100644
index 00000000..efa992c4
--- /dev/null
+++ b/after/autoload/styledcomplete.vim
@@ -0,0 +1,21 @@
+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