diff --git a/README.md b/README.md index c345b13..7b91bd3 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,8 @@ vim.g.lazygit_use_custom_config_file_path = 0 -- config file path is evaluated i vim.g.lazygit_config_file_path = '' -- custom config file path -- OR vim.g.lazygit_config_file_path = {} -- table of custom config file paths + +vim.g.lazygit_on_exit_callback = nil -- optional function callback when exiting lazygit (useful for example to refresh some UI elements after lazy git has made some changes) ``` Call `:LazyGit` to start a floating window with `lazygit` in the current working directory. diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 1d1064b..bdf32b9 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -35,6 +35,10 @@ local function on_exit(job_id, code, event) buffer = -1 win = -1 end + + if vim.g.lazygit_on_exit_callback ~= nil then + vim.g.lazygit_on_exit_callback() + end end --- Call lazygit