-
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Hi there I get errors on my system running your example function - Claude corrected it in a way that works for me:
do
local _, neorg = pcall(require, "neorg.core")
local dirman = neorg.modules.get_module("core.dirman")
local function get_todos(fallback_dir, states)
local current_workspace = dirman.get_current_workspace()
-- Extract the path string from the workspace info
local workspace_path = current_workspace and current_workspace[2] or fallback_dir
-- Ensure we have a string path, not a table
local dir_path = type(workspace_path) == "string" and workspace_path or fallback_dir
require('telescope.builtin').live_grep{ cwd = dir_path }
vim.fn.feedkeys('^ *([*]+|[-]+) +[(]' .. states .. '[)]')
end
-- This can be bound to a key
vim.keymap.set('n', '<leader>at', function() get_todos('~/notes', '[^x_]') end)
end
Metadata
Metadata
Assignees
Labels
No labels