Skip to content

Commit 62c15f6

Browse files
committed
Issue #294 better one line scope
1 parent 55da36b commit 62c15f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

indent/javascript.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let s:continuation_regex = '\%([\\*+/.:]\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\|[^=]
6666
" TODO: this needs to deal with if ...: and so on
6767
let s:msl_regex = s:continuation_regex.'|'.s:expr_case
6868

69-
let s:one_line_scope_regex = '\%(\<\%(if\|else\|for\|while\)\>\|=>\)[^{;]*' . s:line_term
69+
let s:one_line_scope_regex = '\%(\<else\>\|\<\%(if\|for\|while\)\>\s*(.*)\)' . s:line_term
7070

7171
" Regex that defines blocks.
7272
let s:block_regex = '\%([{[]\)\s*\%(|\%([*@]\=\h\w*,\=\s*\)\%(,\s*[*@]\=\h\w*\)*|\)\=' . s:line_term

0 commit comments

Comments
 (0)