Skip to content

Commit

Permalink
Fix for empty buffer :Git command in Neovim (#785)
Browse files Browse the repository at this point in the history
Detects whether the current buffer is empty; opens a new empty tab if so, a new tab of the same buffer if not.
  • Loading branch information
J3RN authored and tpope committed Feb 10, 2017
1 parent 245ce88 commit f44845e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugin/fugitive.vim
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,11 @@ function! s:Git(bang, args) abort
let args = matchstr(a:args,'\v\C.{-}%($|\\@<!%(\\\\)*\|)@=')
if exists(':terminal')
let dir = s:repo().tree()
-tabedit %
if expand('%') != ''
-tabedit %
else
-tabnew
endif
execute 'lcd' fnameescape(dir)
execute 'terminal' git args
else
Expand Down

0 comments on commit f44845e

Please sign in to comment.