Skip to content

Commit 91314f3

Browse files
authored
fix objects after ternary ':'
this will not be an issue since nobody uses labels for simple blocks, and if they do it is adjustable
1 parent b53274d commit 91314f3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

indent/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ endfunction
8383
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
8484
function s:IsBlock()
8585
return getline(line('.'))[col('.')-1] == '{' && !search(
86-
\ '\C\%(\<return\s*\|\%([-=~!<*+,.?^%|&\[(]\|=\@<!>\|\*\@<!\/\|\<\%(var\|const\|let\|import\|export\%(\_s\+default\)\=\|yield\|delete\|void\|t\%(ypeof\|hrow\)\|new\|in\%(stanceof\)\=\)\)\_s*\)\%#','bnW') &&
87-
\ (!search('[:{]\_s*\%#','bW') || (!s:GetPair('[({[]','[])}]','cbW',200) || s:IsBlock()))
86+
\ '\C\%(\<return\s*\|\%([-=~!<*+,.:?^%|&\[(]\|=\@<!>\|\*\@<!\/\|\<\%(var\|const\|let\|import\|export\%(\_s\+default\)\=\|yield\|delete\|void\|t\%(ypeof\|hrow\)\|new\|in\%(stanceof\)\=\)\)\_s*\)\%#','bnW') &&
87+
\ (!search('{\_s*\%#','bW') || s:IsBlock())
8888
endfunction
8989

9090
" Auxiliary Functions {{{2

0 commit comments

Comments
 (0)