make color toggle global

This commit is contained in:
sgraves committed 2026-09-30 14:45:54 +00:00
1 parent fae2f73e60
commit b154bdbbab
1 file changed
+13 -7
+13 -7
View File
@@ -1204,17 +1204,23 @@ function M.toggle()
opts opts
) )
-- Color highlighting -- Color highlighting (global)
km.nmap( km.nmap(
km.leader2 "tc", km.leader2 "tc",
function() function()
local hipatterns = require("mini.hipatterns") local hipatterns = require("mini.hipatterns")
local bufnr = vim.api.nvim_get_current_buf() vim.g.minihipatterns_disable = not vim.g.minihipatterns_disable
hipatterns.toggle(bufnr) local enabled = not vim.g.minihipatterns_disable
utils.notify_setting_enabled( for _, bufnr in ipairs(vim.api.nvim_list_bufs()) do
"Color highlighting", if vim.api.nvim_buf_is_loaded(bufnr) then
vim.tbl_contains(hipatterns.get_enabled_buffers(), bufnr) if enabled then
) pcall(hipatterns.enable, bufnr)
else
pcall(hipatterns.disable, bufnr)
end
end
end
utils.notify_setting_enabled("Color highlighting", enabled)
end, end,
opts opts
) )