mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 19:43:46 -05:00
Set cursorbind in :Gblame
This commit is contained in:
@@ -1725,12 +1725,18 @@ function! s:Blame(bang,line1,line2,count,args) abort
|
|||||||
endif
|
endif
|
||||||
for winnr in range(winnr('$'),1,-1)
|
for winnr in range(winnr('$'),1,-1)
|
||||||
call setwinvar(winnr, '&scrollbind', 0)
|
call setwinvar(winnr, '&scrollbind', 0)
|
||||||
|
if exists('+cursorbind')
|
||||||
|
call setwinvar(winnr, '&cursorbind', 0)
|
||||||
|
endif
|
||||||
if getbufvar(winbufnr(winnr), 'fugitive_blamed_bufnr')
|
if getbufvar(winbufnr(winnr), 'fugitive_blamed_bufnr')
|
||||||
execute winbufnr(winnr).'bdelete'
|
execute winbufnr(winnr).'bdelete'
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
let bufnr = bufnr('')
|
let bufnr = bufnr('')
|
||||||
let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
|
let restore = 'call setwinvar(bufwinnr('.bufnr.'),"&scrollbind",0)'
|
||||||
|
if exists('+cursorbind')
|
||||||
|
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&cursorbind",0)'
|
||||||
|
endif
|
||||||
if &l:wrap
|
if &l:wrap
|
||||||
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)'
|
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&wrap",1)'
|
||||||
endif
|
endif
|
||||||
@@ -1738,6 +1744,9 @@ function! s:Blame(bang,line1,line2,count,args) abort
|
|||||||
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
|
let restore .= '|call setwinvar(bufwinnr('.bufnr.'),"&foldenable",1)'
|
||||||
endif
|
endif
|
||||||
setlocal scrollbind nowrap nofoldenable
|
setlocal scrollbind nowrap nofoldenable
|
||||||
|
if exists('+cursorbind')
|
||||||
|
setlocal cursorbind
|
||||||
|
endif
|
||||||
let top = line('w0') + &scrolloff
|
let top = line('w0') + &scrolloff
|
||||||
let current = line('.')
|
let current = line('.')
|
||||||
let s:temp_files[tolower(temp)] = { 'dir': s:repo().dir(), 'args': cmd }
|
let s:temp_files[tolower(temp)] = { 'dir': s:repo().dir(), 'args': cmd }
|
||||||
@@ -1748,6 +1757,9 @@ function! s:Blame(bang,line1,line2,count,args) abort
|
|||||||
execute top
|
execute top
|
||||||
normal! zt
|
normal! zt
|
||||||
execute current
|
execute current
|
||||||
|
if exists('+cursorbind')
|
||||||
|
setlocal cursorbind
|
||||||
|
endif
|
||||||
setlocal nomodified nomodifiable nonumber scrollbind nowrap foldcolumn=0 nofoldenable winfixwidth filetype=fugitiveblame
|
setlocal nomodified nomodifiable nonumber scrollbind nowrap foldcolumn=0 nofoldenable winfixwidth filetype=fugitiveblame
|
||||||
if exists('+concealcursor')
|
if exists('+concealcursor')
|
||||||
setlocal concealcursor=nc conceallevel=2
|
setlocal concealcursor=nc conceallevel=2
|
||||||
|
|||||||
Reference in New Issue
Block a user