From aa72be3a095107eb4e9a325caeab081b0148744c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Fri, 23 Oct 2009 14:02:01 -0400 Subject: [PATCH] Don't delete unloaded buffers in :Gwrite --- plugin/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 74e360f..6e2830b 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -708,7 +708,7 @@ function! s:Write(force,...) abort let two = s:repo().translate(':2:'.path) let three = s:repo().translate(':3:'.path) for nr in range(1,bufnr('$')) - if !getbufvar(nr,'&modified') && (bufname(nr) == one || bufname(nr) == two || bufname(nr) == three) + if bufloaded(nr) && !getbufvar(nr,'&modified') && (bufname(nr) == one || bufname(nr) == two || bufname(nr) == three) execute nr.'bdelete' endif endfor