mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
refactor: define echo_execution_message before using
This commit is contained in:
@@ -53,6 +53,17 @@ local function debounce(lfn, duration)
|
||||
return inner_debounce
|
||||
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 '']])
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function M.save(buf)
|
||||
buf = buf or api.nvim_get_current_buf()
|
||||
|
||||
@@ -87,17 +98,6 @@ function M.save(buf)
|
||||
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 '']])
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local save_func = nil
|
||||
|
||||
local function perform_save()
|
||||
|
||||
Reference in New Issue
Block a user