fix(mini.animate): schedule the toggle mapping to correctly take effect

This commit is contained in:
Iordanis Petkakis 2025-09-20 22:03:31 +03:00
parent b4606f9df3
commit 2085cf8045

View file

@ -32,15 +32,19 @@ return {
end, end,
}) })
Snacks.toggle({ -- schedule setting the mapping to override the default mapping from `keymaps.lua`
name = "Mini Animate", -- seems `keymaps.lua` is the last event to execute on `VeryLazy` and it overwrites it
get = function() vim.schedule(function()
return not vim.g.minianimate_disable Snacks.toggle({
end, name = "Mini Animate",
set = function(state) get = function()
vim.g.minianimate_disable = not state return not vim.g.minianimate_disable
end, end,
}):map("<leader>ua") set = function(state)
vim.g.minianimate_disable = not state
end,
}):map("<leader>ua")
end)
local animate = require("mini.animate") local animate = require("mini.animate")
return vim.tbl_deep_extend("force", opts, { return vim.tbl_deep_extend("force", opts, {