Skip to content

Commit 8c0618c

Browse files
committed
check getcurpos exists
1 parent 8afb0aa commit 8c0618c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

autoload/ctrlp.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ fu! s:Update(str)
653653
endf
654654

655655
fu! s:ForceUpdate()
656-
let pos = getcurpos()
656+
let pos = exists('*getcurpos') ? getcurpos() : getpos('.')
657657
sil! cal s:Update(escape(s:getinput(), '\'))
658658
cal setpos('.', pos)
659659
endf
@@ -839,7 +839,7 @@ fu! s:PrtSelectMove(dir)
839839
let wht = winheight(0)
840840
let dirs = {'t': 'gg','b': 'G','j': 'j','k': 'k','u': wht.'k','d': wht.'j'}
841841
exe 'keepj norm!' dirs[a:dir]
842-
let pos = getcurpos()
842+
let pos = exists('*getcurpos') ? getcurpos() : getpos('.')
843843
cal s:BuildPrompt(0)
844844
cal setpos('.', pos)
845845
endf
@@ -864,7 +864,7 @@ fu! s:PrtSelectJump(char)
864864
let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]]
865865
en
866866
exe 'keepj norm!' ( jmpln + 1 ).'G'
867-
let pos = getcurpos()
867+
let pos = exists('*getcurpos') ? getcurpos() : getpos('.')
868868
cal s:BuildPrompt(0)
869869
cal setpos('.', pos)
870870
en

0 commit comments

Comments
 (0)