Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/neogit/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ function M.editor(target, client, show_diff)
logger.debug(("[CLIENT] Invoked editor with target: %s, from: %s"):format(target, client))
require("neogit.process").hide_preview_buffers()

if config.values.auto_close_console then
require("neogit.process").close_git_hook_buffers()
end

local rpc_client = RPC.create_connection(client)

---on_unload callback when closing editor
Expand Down
14 changes: 14 additions & 0 deletions lua/neogit/process.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,20 @@ function Process.hide_preview_buffers()
end
end

function Process.close_git_hook_buffers()
for _, v in pairs(processes) do
if v.git_hook then
v:close()
end
end
end

function Process:close()
if self.buffer then
self.buffer:close()
end
end

function Process:show_console()
if self.buffer then
self.buffer:show()
Expand Down