From 5dd1a7e83966c92d220073185f1738dfe441f59e Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Mon, 2 May 2016 10:42:37 +0200 Subject: Update --- after/syntax/jsx.vim | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'after/syntax/jsx.vim') diff --git a/after/syntax/jsx.vim b/after/syntax/jsx.vim index 0aafca12..de544a37 100644 --- a/after/syntax/jsx.vim +++ b/after/syntax/jsx.vim @@ -32,12 +32,23 @@ endif " - othree/yajs.vim: javascriptNoReserved +" JSX attributes should color as JS. Note the trivial end pattern; we let +" jsBlock take care of ending the region. +syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock + +" JSX child blocks behave just like JSX attributes, except that (a) they are +" syntactically distinct, and (b) they need the syn-extend argument, or else +" nested XML end-tag patterns may end the outer jsxRegion. +syn region jsxChild contained start=+{+ end=++ contains=jsBlock,javascriptBlock + \ extend + " Highlight JSX regions as XML; recursively match. " " Note that we prohibit JSX tags from having a < or word character immediately " preceding it, to avoid conflicts with, respectively, the left shift operator " and generic Flow type annotations (http://flowtype.org/). -syn region jsxRegion contains=@XMLSyntax,jsxRegion,jsBlock,javascriptBlock +syn region jsxRegion + \ contains=@XMLSyntax,jsxRegion,jsxChild,jsBlock,javascriptBlock \ start=+\%(<\|\w\)\@+ \ end=++ @@ -45,10 +56,6 @@ syn region jsxRegion contains=@XMLSyntax,jsxRegion,jsBlock,javascriptBlock \ keepend \ extend -" JSX attributes should color as JS. Note the trivial end pattern; we let -" jsBlock take care of ending the region. -syn region xmlString contained start=+{+ end=++ contains=jsBlock,javascriptBlock - " Add jsxRegion to the lowest-level JS syntax cluster. syn cluster jsExpression add=jsxRegion -- cgit v1.2.3