mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-16 20:34:39 +02:00
fix: deal with deprecated util methods
This commit is contained in:
parent
93a5323ba6
commit
d455a7f8ce
7 changed files with 123 additions and 106 deletions
|
@ -177,4 +177,20 @@ function M.setup()
|
|||
end, { desc = "Show info about the formatters for the current buffer" })
|
||||
end
|
||||
|
||||
---@param buf? boolean
|
||||
function M.snacks_toggle(buf)
|
||||
return Snacks.toggle({
|
||||
name = "Auto Format (" .. (buf and "Buffer" or "Global") .. ")",
|
||||
get = function()
|
||||
if not buf then
|
||||
return vim.g.autoformat == nil or vim.g.autoformat
|
||||
end
|
||||
return LazyVim.format.enabled()
|
||||
end,
|
||||
set = function(state)
|
||||
LazyVim.format.enable(state, buf)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue