Skip to content

Commit e110653

Browse files
authored
fix for unnested js in <script>
1 parent d3d8a97 commit e110653

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

indent/javascript.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,11 @@ function GetJavascriptIndent()
469469
elseif num
470470
return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
471471
endif
472-
return b_l + is_op
472+
let ret = b_l + is_op
473+
if !ret && exists('b:hi_indent.blocklnr')
474+
return indent(b:hi_indent.blocklnr) + s:sw()
475+
endif
476+
return ret
473477
endfunction
474478

475479
let &cpo = s:cpo_save

0 commit comments

Comments
 (0)