Skip to content

Commit e9a59c8

Browse files
authored
hotfix: Improve switch
This isn't worth starting dev branch again
1 parent 3abb9ae commit e9a59c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: indent/javascript.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ function GetJavascriptIndent()
235235
let stmt = 1
236236
if s:current_char() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0 && s:previous_token() ==# 'switch'
237237
let switch_offset = &cino !~ ':' || !has('float') ? s:W :
238-
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '.*:[^,]*s' ? s:W : 1))
238+
\ float2nr(str2float(matchstr(&cino,'.*:\zs[-0-9.]*')) * (&cino =~# '\%(.*:\)\@>[^,]*s' ? s:W : 1))
239239
if l:line =~# '^' . s:case_stmt
240240
return indent(num) + switch_offset
241241
endif

0 commit comments

Comments
 (0)