Skip to content

other arrow syntaxes #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions indent/javascript.vim
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function s:GetMSL(lnum, in_one_line_scope)
let msl = lnum

" if there are more closing brackets, continue from the line which has the matching opening bracket
elseif col2 > 0 && !s:IsInStringOrComment(msl, col2) && s:LineHasOpeningBrackets(msl)[0] == '2'
elseif col2 > 0 && !s:IsInStringOrComment(msl, col2) && s:LineHasOpeningBrackets(msl)[0] == '2' && !a:in_one_line_scope
call cursor(msl, 1)
if searchpair('(', '', ')', 'bW', s:skip_expr) > 0
let lnum = line('.')
Expand Down Expand Up @@ -490,12 +490,12 @@ function GetJavascriptIndent()
if line =~ '[[({]'
let counts = s:LineHasOpeningBrackets(lnum)
if counts[0] == '1' && searchpair('(', '', ')', 'bW', s:skip_expr) > 0
if col('.') + 1 == col('$')
if col('.') + 1 == col('$') || line =~ s:one_line_scope_regex
return ind + s:sw()
else
return virtcol('.')
endif
elseif counts[1] == '1' || counts[2] == '1'
elseif counts[1] == '1' || counts[2] == '1' && counts[0] != '2'
return ind + s:sw()
else
call cursor(v:lnum, vcol)
Expand Down