From 362ce47ed173d4ddde4368168739614c1acdbb68 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 8 Jul 2019 09:11:18 -0400 Subject: [PATCH] Force hyphen in :Gblame -opts I want to change the interface to allow passing an optional filename. --- autoload/fugitive.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index d5c082d..d44c240 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -4057,10 +4057,11 @@ function! s:BlameCommand(line1, line2, range, count, bang, mods, reg, arg, args) if empty(s:Relative('/')) call s:throw('file or blob required') 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') endif - call map(a:args,'s:sub(v:val,"^\\ze[^-]","-")') let cmd = ['--no-pager', 'blame', '--show-number'] if a:count let cmd += ['-L', a:line1 . ',' . a:line1]