Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
" Language: Javascript
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
" Last Change: July 30, 2016
" Last Change: July 31, 2016

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