feat: added options to configure change detection. Fixes #32

This commit is contained in:
Folke Lemaitre 2022-12-20 19:38:32 +01:00
parent cd162f342a
commit 6c767a604d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
2 changed files with 14 additions and 5 deletions

View file

@ -68,11 +68,13 @@ function M.check(start)
if not (start or #changes == 0) then
vim.schedule(function()
local lines = { "# Config Change Detected. Reloading...", "" }
for _, change in ipairs(changes) do
table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`")
if Config.options.change_detection.notify then
local lines = { "# Config Change Detected. Reloading...", "" }
for _, change in ipairs(changes) do
table.insert(lines, "- **" .. change.what .. "**: `" .. vim.fn.fnamemodify(change.file, ":p:~:.") .. "`")
end
Util.warn(lines)
end
Util.warn(lines)
Plugin.load()
vim.cmd([[do User LazyRender]])
end)