Skip to content

Commit

Permalink
Fix #4 indent is broken in tertiary operator.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxMEllon committed Nov 17, 2016
1 parent 37bbfb4 commit 206a976
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions after/indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ function! GetJsxIndent()
let ind = ind + s:sw()
endif

if getline(v:lnum - 1) =~? ':' && getline(v:lnum - 2) =~? '?'
let ind = ind - s:sw() * 2
endif

" return ( | return (
" <div> | <div>
" </div> | </div>
Expand Down

0 comments on commit 206a976

Please sign in to comment.