From a48836ad6f4e8aae8b1dcd5b5c0d8a5935271abc Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 7 Mar 2018 21:04:01 +0100 Subject: git-blamer: Use `cursor()` instead of `setpos()` Use the `cursor()` function to set the position of the cursor. This call is simpler than `setpos()`, and more descriptive than `execute l:top_line` (that was inspired by fugitive.vim, https://github.com/tpope/vim-fugitive/blob/f3ccb0c12ee4985b8808f83059830a24cc92821c/plugin/fugitive.vim#L2048-L2064) --- bundle/git-blamer/autoload/git_blamer.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bundle/git-blamer/autoload/git_blamer.vim') diff --git a/bundle/git-blamer/autoload/git_blamer.vim b/bundle/git-blamer/autoload/git_blamer.vim index 40ffddb..d12578b 100644 --- a/bundle/git-blamer/autoload/git_blamer.vim +++ b/bundle/git-blamer/autoload/git_blamer.vim @@ -25,9 +25,9 @@ function! git_blamer#Blame() setlocal nomodified nomodifiable " Move cursor to position in starting file - execute l:top_line + call cursor(l:top_line, 0) normal! zt - call setpos('.', [0, l:line_number, 0, 0]) + call cursor(l:line_number, 0) setlocal noswapfile nowrap nolist nobuflisted buftype=nofile bufhidden=wipe setlocal scrollbind cursorbind -- cgit v1.2.3