mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-09 03:53:47 -05:00
Remove redundant exists(':Gblame') check
This command used to be restricted to file and blob buffers, but now it's global, not to mention deprecated, and the check serves no purpose.
This commit is contained in:
@@ -5443,30 +5443,28 @@ function! s:BlameJump(suffix, ...) abort
|
|||||||
execute 'Gedit' s:fnameescape(commit . suffix . ':' . path)
|
execute 'Gedit' s:fnameescape(commit . suffix . ':' . path)
|
||||||
execute lnum
|
execute lnum
|
||||||
endif
|
endif
|
||||||
if exists(':Gblame')
|
let my_bufnr = bufnr('')
|
||||||
let my_bufnr = bufnr('')
|
if blame_bufnr < 0
|
||||||
if blame_bufnr < 0
|
let blame_args = flags + [commit . suffix, '--', path]
|
||||||
let blame_args = flags + [commit . suffix, '--', path]
|
let result = s:BlameSubcommand(0, 0, 0, 0, '', extend({'args': blame_args}, state.options, 'keep'))
|
||||||
let result = s:BlameSubcommand(0, 0, 0, 0, '', extend({'args': blame_args}, state.options, 'keep'))
|
else
|
||||||
else
|
let blame_args = flags
|
||||||
let blame_args = flags
|
let result = s:BlameSubcommand(-1, -1, 0, 0, '', extend({'args': blame_args}, state.options, 'keep'))
|
||||||
let result = s:BlameSubcommand(-1, -1, 0, 0, '', extend({'args': blame_args}, state.options, 'keep'))
|
|
||||||
endif
|
|
||||||
if bufnr('') == my_bufnr
|
|
||||||
return result
|
|
||||||
endif
|
|
||||||
execute result
|
|
||||||
execute lnum
|
|
||||||
let delta = line('.') - line('w0') - offset
|
|
||||||
if delta > 0
|
|
||||||
execute 'normal! '.delta."\<C-E>"
|
|
||||||
elseif delta < 0
|
|
||||||
execute 'normal! '.(-delta)."\<C-Y>"
|
|
||||||
endif
|
|
||||||
keepjumps syncbind
|
|
||||||
redraw
|
|
||||||
echo ':Gblame' s:fnameescape(blame_args)
|
|
||||||
endif
|
endif
|
||||||
|
if bufnr('') == my_bufnr
|
||||||
|
return result
|
||||||
|
endif
|
||||||
|
execute result
|
||||||
|
execute lnum
|
||||||
|
let delta = line('.') - line('w0') - offset
|
||||||
|
if delta > 0
|
||||||
|
execute 'normal! '.delta."\<C-E>"
|
||||||
|
elseif delta < 0
|
||||||
|
execute 'normal! '.(-delta)."\<C-Y>"
|
||||||
|
endif
|
||||||
|
keepjumps syncbind
|
||||||
|
redraw
|
||||||
|
echo ':Git blame' s:fnameescape(blame_args)
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user