From 7cef92fffe4bf020fba08cdc8ad50b137e7b7974 Mon Sep 17 00:00:00 2001
From: Junegunn Choi <junegunn.c@gmail.com>
Date: Tue, 2 Aug 2016 03:30:17 +0900
Subject: [PATCH] [vim] Delete fzf buffer even when exit status is non-zero

Fix #183
---
 plugin/fzf.vim | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index dc18470c..b7e7dc49 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -452,14 +452,14 @@ function! s:execute_term(dict, command, temps) abort
       execute self.ppos.win.'wincmd w'
     endif
 
-    if !s:exit_handler(a:code, self.command, 1)
-      return
-    endif
-
     if bufexists(self.buf)
       execute 'bd!' self.buf
     endif
 
+    if !s:exit_handler(a:code, self.command, 1)
+      return
+    endif
+
     call s:pushd(self.dict)
     let lines = s:collect(self.temps)
     call s:callback(self.dict, lines)
-- 
GitLab