From 0cd33c617006a07331bf45c0970e3d4e82680f6a Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 29 Jun 2014 14:52:43 -0400 Subject: [PATCH] :Gcommit -v opens message in new tab Closes #513. References #480. --- doc/fugitive.txt | 12 ++++++------ plugin/fugitive.vim | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index 2b9a5d3..322ed5f 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -63,12 +63,12 @@ that are part of Git repositories). to commit, |:Gstatus| is called instead. Unless the arguments given would skip the invocation of an editor (e.g., -m), a split window will be used to obtain a - commit message. Write and close that window (:wq or - |:Gwrite|) to finish the commit. Unlike when running - the actual git-commit command, it is possible (but - unadvisable) to muck with the index with commands like - git-add and git-reset while a commit message is - pending. + commit message, or a new tab if -v is given. Write + and close that window (:wq or |:Gwrite|) to finish the + commit. Unlike when running the actual git-commit + command, it is possible (but unadvisable) to alter the + index with commands like git-add and git-reset while a + commit message is pending. *fugitive-:Gmerge* :Gmerge [args] Calls git-merge and loads errors and conflicted files diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index a47d328..031a04a 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -1015,6 +1015,8 @@ function! s:Commit(args) abort endif if bufname('%') == '' && line('$') == 1 && getline(1) == '' && !&mod execute 'keepalt edit '.s:fnameescape(msgfile) + elseif a:args =~# '\%(^\| \)-\%(-verbose\|\w*v\)\>' + execute 'keepalt tabedit '.s:fnameescape(msgfile) elseif s:buffer().type() ==# 'index' execute 'keepalt edit '.s:fnameescape(msgfile) execute (search('^#','n')+1).'wincmd+'