feat: allow to disable execution_message

Squashed changes from https://github.com/Pocco81/auto-save.nvim/pull/50
Got too hairy for a GH noob like me to fix properly.
This commit is contained in:
Jakub Łuczyński
2023-02-12 18:18:09 +02:00
committed by Oula Kuuva
parent 492bab0c47
commit 4db41a2155
3 changed files with 17 additions and 16 deletions
+8 -9
View File
@@ -82,15 +82,14 @@ function M.save(buf)
callback("after_saving")
api.nvim_echo({
{
(
type(cnf.opts.execution_message.message) == "function" and cnf.opts.execution_message.message()
or cnf.opts.execution_message.message
),
AUTO_SAVE_COLOR,
},
}, true, {})
if cnf.opts.execution_message.enabled == true then
echo_execution_message()
end
end
local function echo_execution_message()
local msg = type(cnf.opts.execution_message.message) == "function" and cnf.opts.execution_message.message() or cnf.opts.execution_message.message
api.nvim_echo({ { msg, AUTO_SAVE_COLOR } }, true, {})
if cnf.opts.execution_message.cleaning_interval > 0 then
fn.timer_start(cnf.opts.execution_message.cleaning_interval, function()
cmd([[echon '']])