mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-10 20:43:46 -05:00
Fix for empty buffer :Git command in Neovim (#785)
Detects whether the current buffer is empty; opens a new empty tab if so, a new tab of the same buffer if not.
This commit is contained in:
committed by
Tim Pope
parent
245ce889e2
commit
f44845e440
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user