Skip to content

Commit

Permalink
Allow messages to be nil - don't show them
Browse files Browse the repository at this point in the history
  • Loading branch information
CKolkey committed Aug 3, 2023
1 parent 1d74014 commit 4973672
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lua/neogit/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ function M.wrap(cmd, opts)

a.util.scheduler()

local notification = notif.create(opts.msg.setup, vim.log.levels.INFO, 9999)
local notification
if opts.msg.setup then
notification = notif.create(opts.msg.setup, vim.log.levels.INFO, 9999)
end

local result = cmd.env(M.get_envs_git_editor()):in_pty(true).call(true):trim()

a.util.scheduler()
Expand All @@ -98,10 +102,15 @@ function M.wrap(cmd, opts)
end

if result.code == 0 then
notif.create(opts.msg.success)
if opts.msg.success then
notif.create(opts.msg.success)
end

vim.api.nvim_exec_autocmds("User", { pattern = opts.autocmd, modeline = false })
else
notif.create(opts.msg.fail)
if opts.msg.fail then
notif.create(opts.msg.fail)
end
end

a.util.scheduler()
Expand Down

0 comments on commit 4973672

Please sign in to comment.