Skip to content

Commit 47b89fb

Browse files
committed
Merge pull request #293 from camsteffen/develop
Issue #291 better one line scope indentation
2 parents 55da36b + 62c15f6 commit 47b89fb

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)