From bebd896c094e478d04693f30ddf64fdbc4dc5944 Mon Sep 17 00:00:00 2001 From: rootiest Date: Tue, 5 Nov 2024 05:53:34 -0500 Subject: [PATCH] feat: implement conditional todo return based on global variable and git repo --- lua/data/cond.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/data/cond.lua b/lua/data/cond.lua index 5346115..e389f80 100644 --- a/lua/data/cond.lua +++ b/lua/data/cond.lua @@ -148,7 +148,14 @@ M.tabnine = function() end M.todo = function() - return vim.bo.readonly == false + if func.check_global_var("usetodo", true, true) then + if vim.bo.readonly == false then + if func.dir_is_git_repo(vim.fn.expand("%:p:h")) then + return true + end + end + end + return false end --- TMux conditional options