Skip to content

Commit 20798cf

Browse files
committed
Remove s:SavePosition() and s:RestorePosition()
These functions made sense for VimClojure, but are unnecessary here
1 parent dd99c9f commit 20798cf

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

indent/clojure.vim

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,6 @@ if exists("*searchpairpos")
7777
endfor
7878
endfunction
7979

80-
function! s:SavePosition()
81-
let [ _b, l, c, _o ] = getpos(".")
82-
let b = bufnr("%")
83-
return [b, l, c]
84-
endfunction
85-
86-
function! s:RestorePosition(value)
87-
let [b, l, c] = a:value
88-
if bufnr("%") != b
89-
execute b "buffer!"
90-
endif
91-
call setpos(".", [0, l, c, 0])
92-
endfunction
93-
9480
function! s:MatchPairs(open, close, stopat)
9581
" Stop only on vector and map [ resp. {. Ignore the ones in strings and
9682
" comments.
@@ -144,11 +130,11 @@ if exists("*searchpairpos")
144130
endfunction
145131

146132
function! s:CheckForString()
147-
let pos = s:SavePosition()
133+
let pos = getpos('.')
148134
try
149135
let val = s:ClojureCheckForStringWorker()
150136
finally
151-
call s:RestorePosition(pos)
137+
call setpos('.', pos)
152138
endtry
153139
return val
154140
endfunction
@@ -180,11 +166,11 @@ if exists("*searchpairpos")
180166
endfunction
181167

182168
function! s:IsMethodSpecialCase(position)
183-
let pos = s:SavePosition()
169+
let pos = getpos('.')
184170
try
185171
let val = s:ClojureIsMethodSpecialCaseWorker(a:position)
186172
finally
187-
call s:RestorePosition(pos)
173+
call setpos('.', pos)
188174
endtry
189175
return val
190176
endfunction

0 commit comments

Comments
 (0)