From 4767a6caa8d22872bbde149a3bd8d6f2bc4830c1 Mon Sep 17 00:00:00 2001 From: yasuda Date: Wed, 7 Aug 2024 14:47:50 +0900 Subject: [PATCH] Allow `++curwin` option to come later --- autoload/fugitive.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 005dd3705d..55f6402b4b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -3791,14 +3791,17 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg, ...) abort exe s:DirCheck(dir) endif let config = copy(fugitive#Config(dir)) - let curwin = a:arg =~# '^++curwin\>' || !a:line2 - let [args, after] = s:SplitExpandChain(substitute(a:arg, '^++curwin\>\s*', '', ''), s:Tree(dir)) + let curwin = !a:line2 + let [args, after] = s:SplitExpandChain(a:arg, s:Tree(dir)) let flags = [] let pager = -1 let explicit_pathspec_option = 0 let did_expand_alias = 0 while len(args) - if args[0] ==# '-c' && len(args) > 1 + if args[0] ==# '++curwin' + let curwin = curwin || v:true + call remove(args, 0) + elseif args[0] ==# '-c' && len(args) > 1 call extend(flags, remove(args, 0, 1)) elseif args[0] =~# '^-p$\|^--paginate$' let pager = 2