From 734cdfc04eddf77e2d37c4f7291defff6334198b Mon Sep 17 00:00:00 2001 From: bounceme Date: Tue, 12 Apr 2016 11:02:15 -0700 Subject: [PATCH] Improve one line scope #293 this will detect the start and end parentheses,allowing statements with parentheses to come after the condition parens.This regex can detect with up to 4 levels of nesting. --- indent/javascript.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indent/javascript.vim b/indent/javascript.vim index 9ed79e4d..27249a8a 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -66,7 +66,7 @@ let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@\|\<\%(if\|for\|while\)\>\s*(.*)\)\|=>\)' . s:line_term +let s:one_line_scope_regex = '\%(\%(\\|\<\%(if\|for\|while\)\>\s*(\%([^()]*\|[^()]*(\%([^()]*\|[^()]*(\%([^()]*\|[^()]*([^()]*)[^()]*\))[^()]*\))[^()]*\))\)\|=>\)' . s:line_term " Regex that defines blocks. let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term