mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
fix: get correct enabled state
This commit is contained in:
parent
8014928cbf
commit
8b4bba893a
2 changed files with 7 additions and 8 deletions
|
|
@ -6,7 +6,7 @@ local M = {}
|
|||
local format_opts = {}
|
||||
|
||||
---@param opts ConformOpts
|
||||
function M.setup(plugin, opts)
|
||||
function M.setup(_, opts)
|
||||
local util = require("conform.util")
|
||||
opts.formatters = opts.formatters or {}
|
||||
for name, formatter in pairs(opts.formatters) do
|
||||
|
|
|
|||
|
|
@ -114,14 +114,13 @@ return {
|
|||
{
|
||||
"<leader>ut",
|
||||
function()
|
||||
local Util = require("lazy.core.util")
|
||||
require("treesitter-context").toggle()
|
||||
if require("treesitter-context.config").enable then
|
||||
require("treesitter-context.config").enable = false
|
||||
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
else
|
||||
require("treesitter-context.config").enable = true
|
||||
local Util = require("lazyvim.util")
|
||||
local tsc = require("treesitter-context")
|
||||
tsc.toggle()
|
||||
if Util.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||
Util.info("Enabled Treesitter Context", { title = "Option" })
|
||||
else
|
||||
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||
end
|
||||
end,
|
||||
desc = "Toggle Treesitter Context",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue