Skip to content

Commit a328e81

Browse files
authored
add label support (#582)
* add label support
1 parent 6706a24 commit a328e81

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

indent/javascript.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
" Language: Javascript
33
" Maintainer: vim-javascript community
44
" URL: https://github.com/pangloss/vim-javascript
5-
" Last Change: July 30, 2016
5+
" Last Change: July 31, 2016
66

77
" Only load this indent file when no other was loaded.
88
if exists("b:did_indent")
@@ -191,7 +191,9 @@ function GetJavascriptIndent()
191191
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (match(&cino,'.*:\zs[^,]*s') ? s:sw() : 1))
192192
let pline = s:StripLine(getline(lnum))
193193
if ((line =~ g:javascript_opfirst ||
194-
\ (pline =~ g:javascript_continuation && pline !~ s:expr_case)) &&
194+
\ (pline =~ g:javascript_continuation && pline !~ s:expr_case &&
195+
\ (pline !~ ':' . s:line_term || line !~# s:line_pre .
196+
\ '\%(debugger\|do\|else\|finally\|for\|if\|let\|switch\|throw\|try\|while\|with\)'))) &&
195197
\ inb) || (s:Onescope(lnum,pline,0) && line !~ s:line_pre . '{')
196198
return (num > 0 ? indent(num) : -s:sw()) + (s:sw() * 2) + switch_offset
197199
elseif num > 0

0 commit comments

Comments
 (0)