diff --git a/after/syntax/javascript.vim b/after/syntax/javascript.vim index d75b5b4..5e4b25d 100644 --- a/after/syntax/javascript.vim +++ b/after/syntax/javascript.vim @@ -145,7 +145,7 @@ syn match cssError contained "{@<>" syn match jsTaggedTemplate extend \ "\\|\\|\\|\" \ nextgroup=styledDefinition -syn match jsFuncCall "\\s*(\k\+)" +syn match jsFuncCall "\\s*(.\+)" transparent \ nextgroup=styledDefinition syn match jsFuncCall "\\s*(\%('\k\+'\|\"\k\+\"\|`\k\+`\))" \ contains=styledTagNameString diff --git a/examples/issue-44.js b/examples/issue-44.js new file mode 100644 index 0000000..a7c37a3 --- /dev/null +++ b/examples/issue-44.js @@ -0,0 +1,35 @@ +import styled from 'styled-components'; + +const Schedule = styled.div` + display: none; +`; + +Schedule.Part = styled.div` + align-items: center; + display: flex; +`; + +const Something = styled(Link)` + align-items: center; + display: none; +`; + +function test() { + return styled.div; +} + +Schedule.CourseTimes = styled(test())` + align-items: flex-start; + + img { + margin-top: 0.3rem; + } +`; + +Schedule.CourseTimes = styled(Schedule.Part)` + align-items: flex-start; + + img { + margin-top: 0.3rem; + } +`;