From 42daa3183bac29e8f10f5a1c99e38d86efffa864 Mon Sep 17 00:00:00 2001 From: Michael Budde Date: Mon, 9 Oct 2017 14:02:16 +0200 Subject: [PATCH] Do not accept :Gread count in argument position Use `-range` instead of `-count` to prevent Vim from interpreting a branch name starting with a number as a count, e.g. `:Gread 123-foo` being interpreted as `:123Gread -foo`. --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index de10198..3f8e4f9 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1486,7 +1486,7 @@ call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gpedi call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gsplit :execute s:Edit('split',0,)") call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gvsplit :execute s:Edit('vsplit',0,)") call s:command("-bar -bang -nargs=* -complete=customlist,s:EditRunComplete Gtabedit :execute s:Edit('tabedit',0,)") -call s:command("-bar -bang -nargs=* -count -complete=customlist,s:EditRunComplete Gread :execute s:Edit((! && ? '' : ).'read',0,)") +call s:command("-bar -bang -nargs=* -range=-1 -complete=customlist,s:EditRunComplete Gread :execute s:Edit(( == -1 ? '' : ).'read',0,)") " Section: Gwrite, Gwq