From 770f9af1c5d4b0d58a2522f9a5977ebebb291ba3 Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Wed, 8 Apr 2020 11:05:35 -0600 Subject: [PATCH] Add callback on BufLeave --- lua/lazygit.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 4512305..cce25fc 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -83,6 +83,7 @@ local function open_floating_window() -- use autocommand to ensure that the border_buffer closes at the same time as the main buffer vim.cmd('autocmd BufWipeout silent! execute "silent bwipeout!"' .. border_buffer) + vim.cmd([[autocmd BufLeave execute "call luaeval(\"require('lazygit').on_buf_leave()\")"]]) end local function on_buf_leave()