mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 14:53:51 -05:00
Force hyphen in :Gblame -opts
I want to change the interface to allow passing an optional filename.
This commit is contained in:
@@ -4057,10 +4057,11 @@ function! s:BlameCommand(line1, line2, range, count, bang, mods, reg, arg, args)
|
|||||||
if empty(s:Relative('/'))
|
if empty(s:Relative('/'))
|
||||||
call s:throw('file or blob required')
|
call s:throw('file or blob required')
|
||||||
endif
|
endif
|
||||||
if filter(copy(a:args),'v:val !~# "^\\%(--abbrev=\\d*\\|--relative-date\\|--first-parent\\|--root\\|--show-name\\|-\\=\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != []
|
if filter(copy(a:args),'v:val !~# "^-"') != []
|
||||||
|
call s:throw("'-' required for all options")
|
||||||
|
elseif filter(copy(a:args),'v:val !~# "^\\%(--abbrev=\\d*\\|--relative-date\\|--first-parent\\|--root\\|--show-name\\|-\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != []
|
||||||
call s:throw('unsupported option')
|
call s:throw('unsupported option')
|
||||||
endif
|
endif
|
||||||
call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")')
|
|
||||||
let cmd = ['--no-pager', 'blame', '--show-number']
|
let cmd = ['--no-pager', 'blame', '--show-number']
|
||||||
if a:count
|
if a:count
|
||||||
let cmd += ['-L', a:line1 . ',' . a:line1]
|
let cmd += ['-L', a:line1 . ',' . a:line1]
|
||||||
|
|||||||
Reference in New Issue
Block a user