Gblame: allow passing --first-parent

Also fixes the filter for `--root` and `--show-name`.
This commit is contained in:
Daniel Hahler 2018-11-18 10:16:08 +01:00 committed by Tim Pope
parent 6d497b0e63
commit e48cf2dadd

View File

@ -2986,7 +2986,7 @@ function! s:Blame(bang, line1, line2, count, mods, args) abort
if empty(s:Relative('/'))
call s:throw('file or blob required')
endif
if filter(copy(a:args),'v:val !~# "^\\%(--root\|--show-name\\|-\\=\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != []
if filter(copy(a:args),'v:val !~# "^\\%(--first-parent\\|--root\\|--show-name\\|-\\=\\%([ltfnsew]\\|[MC]\\d*\\)\\+\\)$"') != []
call s:throw('unsupported option')
endif
call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")')