Skip to content

Commit 3cb2283

Browse files
authored
indent: fix indenting within parens
move cursor to real end of previous line, and include end-of-line character in searchpair() using c flag
1 parent 1eaba53 commit 3cb2283

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/swift.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ function! SwiftIndent(...)
225225
if numOpenParens > 0
226226
let savePosition = getcurpos()
227227
" Must be at EOL because open paren has to be above (left of) the cursor
228-
call cursor(previousNum, col("$"))
229-
let previousParen = searchpair("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
228+
call cursor(previousNum, [previousNum, col("$")])
229+
let previousParen = searchpair("(", "", ")", "cbWn", "s:IsExcludedFromIndent()")
230230
call setpos(".", savePosition)
231231
return indent(previousParen) + shiftwidth()
232232
endif

0 commit comments

Comments
 (0)