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 = {}
|
local format_opts = {}
|
||||||
|
|
||||||
---@param opts ConformOpts
|
---@param opts ConformOpts
|
||||||
function M.setup(plugin, opts)
|
function M.setup(_, opts)
|
||||||
local util = require("conform.util")
|
local util = require("conform.util")
|
||||||
opts.formatters = opts.formatters or {}
|
opts.formatters = opts.formatters or {}
|
||||||
for name, formatter in pairs(opts.formatters) do
|
for name, formatter in pairs(opts.formatters) do
|
||||||
|
|
|
||||||
|
|
@ -114,14 +114,13 @@ return {
|
||||||
{
|
{
|
||||||
"<leader>ut",
|
"<leader>ut",
|
||||||
function()
|
function()
|
||||||
local Util = require("lazy.core.util")
|
local Util = require("lazyvim.util")
|
||||||
require("treesitter-context").toggle()
|
local tsc = require("treesitter-context")
|
||||||
if require("treesitter-context.config").enable then
|
tsc.toggle()
|
||||||
require("treesitter-context.config").enable = false
|
if Util.inject.get_upvalue(tsc.toggle, "enabled") then
|
||||||
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
|
||||||
else
|
|
||||||
require("treesitter-context.config").enable = true
|
|
||||||
Util.info("Enabled Treesitter Context", { title = "Option" })
|
Util.info("Enabled Treesitter Context", { title = "Option" })
|
||||||
|
else
|
||||||
|
Util.warn("Disabled Treesitter Context", { title = "Option" })
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
desc = "Toggle Treesitter Context",
|
desc = "Toggle Treesitter Context",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue