Skip to content

Commit 206a976

Browse files
committed
Fix #4 indent is broken in tertiary operator.
1 parent 37bbfb4 commit 206a976

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

after/indent/javascript.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ function! GetJsxIndent()
9292
let ind = ind + s:sw()
9393
endif
9494

95+
if getline(v:lnum - 1) =~? ':' && getline(v:lnum - 2) =~? '?'
96+
let ind = ind - s:sw() * 2
97+
endif
98+
9599
" return ( | return (
96100
" <div> | <div>
97101
" </div> | </div>

0 commit comments

Comments
 (0)