From 61390f58850c34b27d2a28dc14ebd760de152cc9 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 22 Jan 2016 09:08:00 +0100 Subject: Update --- after/indent/jsx.vim | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'after/indent/jsx.vim') diff --git a/after/indent/jsx.vim b/after/indent/jsx.vim index f4c36662..e5fdb45d 100644 --- a/after/indent/jsx.vim +++ b/after/indent/jsx.vim @@ -26,8 +26,8 @@ setlocal indentkeys=0{,0},0),0],0\,,!^F,o,O,e " XML indentkeys setlocal indentkeys+=*,<>>,<<>,/ -" Self-closing tag regex. -let s:sctag = '^\s*\/>\s*;\=' +" Multiline end tag regex (line beginning with '>' or '/>') +let s:endtag = '^\s*\/\?>\s*;\=' " Get all syntax types at the beginning of a given line. fu! SynSOL(lnum) @@ -76,13 +76,13 @@ fu! GetJsxIndent() if (SynXMLish(prevsyn) || SynJSXBlockEnd(prevsyn)) && SynXMLishAny(cursyn) let ind = XmlIndentGet(v:lnum, 0) - " Align '/>' with '<' for multiline self-closing tags. - if getline(v:lnum) =~? s:sctag + " Align '/>' and '>' with '<' for multiline tags. + if getline(v:lnum) =~? s:endtag let ind = ind - &sw endif - " Then correct the indentation of any JSX following '/>'. - if getline(v:lnum - 1) =~? s:sctag + " Then correct the indentation of any JSX following '/>' or '>'. + if getline(v:lnum - 1) =~? s:endtag let ind = ind + &sw endif else -- cgit v1.2.3