Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
fleischie committed Aug 13, 2018
2 parents 14aa8cc + 665ee8a commit 38b22ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
4 changes: 3 additions & 1 deletion after/autoload/styledcomplete.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ fun! styledcomplete#CompleteSC(findstart, base)
return csscomplete#CompleteCSS(a:findstart, a:base)
endif

return javascriptcomplete#CompleteJS(a:findstart, a:base)
" create a funcref to call with the previous omnicomplete function
let s:funcref = function(b:prevofu)
return s:funcref(a:findstart, a:base)
endfun
1 change: 1 addition & 0 deletions after/ftplugin/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ fu! IsStyledDefinition(lnum)
endfu

if exists('&ofu')
let b:prevofu=&ofu
setl omnifunc=styledcomplete#CompleteSC
endif
12 changes: 9 additions & 3 deletions after/syntax/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ syn match cssCustomPageMargin contained skipwhite skipnl
syn match cssCustomKeyFrameSelector "\%(\d*%\|\<from\>\|\<to\>\)" contained
\ skipwhite skipnl

" define css include customly to overwrite nextgroup
syn region cssInclude start="@media\>" end="\ze{" skipwhite skipnl
\ contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,
\ cssMediaMediaAttr,cssVencor,cssMediaType,cssIncludeKeyword,
\ cssMediaComma,cssComment
\ nextgroup=cssCustomMediaBlock

" define all non-contained css definitions
syn cluster CSSTop
\ contains=cssTagName,cssSelectorOp,cssAttributeSelector,cssClassName,
\ cssBraces,cssIdentifier,cssInclude,cssPage,cssKeyFrame,
\ cssInclude,cssFontDescriptor,cssAttrComma,cssPseudoClass,
\ cssUnicodeEscape
\ cssBraces,cssIdentifier,cssIncludeKeyword,cssPage,cssKeyFrame,
\ cssFontDescriptor,cssAttrComma,cssPseudoClass,cssUnicodeEscape

" custom highlights for styled components
" - "&" inside top level
Expand Down
16 changes: 16 additions & 0 deletions examples/issue-47.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const Container = styled.div`
display: grid;
border: 1px solid black;
&:hover {
color: blue;
}
@media (max-width: 700px) {
grid-template-column: 1fr 0px;
}
media (max-width: 700px) {
grid-template-column: 1fr 0px;
}
`;

0 comments on commit 38b22ba

Please sign in to comment.