Skip to content

Commit 6d8e7ac

Browse files
Do not show empty split for Git help <cmd> on Windows
Git for Windows shows help for its subcommands in a browser; so `Git help rebase`, for example, brings up empty split. This commit covers notable exceptions to that: `git help`, `git help -a`, `git help -g`, `git help --man` and `git --help`.
1 parent 61b51c0 commit 6d8e7ac

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoload/fugitive.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3761,8 +3761,12 @@ function! fugitive#PagerFor(argv, ...) abort
37613761
let args = a:argv
37623762
if empty(args)
37633763
return 0
3764-
elseif (args[0] ==# 'help' || get(args, 1, '') ==# '--help') && !s:HasOpt(args, '--web')
3764+
elseif len(args) == 1 && args[0] =~# '\v^(help|-h)$'
3765+
return 1
3766+
elseif len(args) == 2 && args[0] ==# 'help' && args[1] =~# '\v^(-[ag]|--man)$'
37653767
return 1
3768+
elseif (args[0] ==# 'help' || get(args, 1, '') ==# '--help') && !s:HasOpt(args, '--web')
3769+
return has('win32') ? 0 : 1
37663770
endif
37673771
if args[0] ==# 'config' && (s:HasOpt(args, '-e', '--edit') ||
37683772
\ !s:HasOpt(args, '--list', '--get-all', '--get-regexp', '--get-urlmatch')) ||

0 commit comments

Comments
 (0)