From b3d566ca5aeeff62cf6e429454074e07fedbc2ce Mon Sep 17 00:00:00 2001 From: aarondill Date: Fri, 13 Oct 2023 04:04:52 -0500 Subject: [PATCH] feat: Add .is_enabled to check current status This allows configurations to do things such as my use case of notifying the new state when using .toggle() --- lua/treesitter-context.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/treesitter-context.lua b/lua/treesitter-context.lua index 219f289f..5eaaa3aa 100644 --- a/lua/treesitter-context.lua +++ b/lua/treesitter-context.lua @@ -177,6 +177,10 @@ function M.toggle() end end +function M.is_enabled() + return enabled +end + local function init() command('TSContextEnable', M.enable, {}) command('TSContextDisable', M.disable, {})