Skip to content

Commit fffc011

Browse files
committed
Unify cursor restoration method across functions
1 parent 4d5c81c commit fffc011

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

indent/swift.vim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ endfunction
5656
" startingPosition - A list [line_number, column_number] representing the position to start the search.
5757
" Returns: A list [line_number, column_number] representing the position of the opening parenthesis.
5858
function! s:SearchOpeningParenPos(startingPosition)
59-
let currentLine = line(".")
60-
let currentColumn = col(".")
59+
let currentPos = getpos(".")
6160
call cursor(a:startingPosition[0], a:startingPosition[1])
6261
let openingParen = searchpairpos("(", "", ")", "bWn", "s:IsExcludedFromIndent()")
63-
call cursor(currentLine, currentColumn)
62+
call cursor(".", currentPos)
6463
return openingParen
6564
endfunction
6665

0 commit comments

Comments
 (0)