diff --git a/indent/javascript.vim b/indent/javascript.vim index e89e493d..f38b7183 100644 --- a/indent/javascript.vim +++ b/indent/javascript.vim @@ -109,9 +109,10 @@ endfunction " https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader function s:IsBlock() - return getline(line('.'))[col('.')-1] == '{' && !search( - \ '\C\%(\\|\*\@') !~# + \ '\<\%(var\|const\|let\|import\|export\|yield\|de\%(fault\|lete\)\|void\|t\%(ypeof\|hrow\)\|new\|in\%(stanceof\)\=\)\>' + \ : !search('\C\%([-=~!<*+,./?^%|&\[(]\|=\@\)\_s*\%#','nbW') && + \ (search(s:expr_case . '\_s*\%#','nbW') || !search('[{:]\_s*\%#','bW') || s:IsBlock())) endfunction " Find line above 'lnum' that isn't empty, in a comment, or in a string.