Skip to content

Commit f7ba7ae

Browse files
committed
fix: correct Path handling in grep picker
- access dir.filename property instead of dir directly - convert Path object to string for cwd option
1 parent 62c546a commit f7ba7ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/obsidian/pickers/_snacks.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ SnacksPicker.grep = function(self, opts)
7676
debug_once("grep opts : ", opts)
7777

7878
---@type obsidian.Path
79-
local dir = opts.dir and Path:new(opts.dir) or self.client.dir
79+
local dir = opts.dir.filename and Path:new(opts.dir.filename) or self.client.dir
8080

8181
local map = vim.tbl_deep_extend("force", {},
8282
notes_mappings(opts.selection_mappings))
8383

8484
local pick_opts = vim.tbl_extend("force", map or {}, {
8585
source = "grep",
8686
title = opts.prompt_title,
87-
cwd = dir,
87+
cwd = tostring(dir),
8888
confirm = function(picker, item, action)
8989
picker:close()
9090
if item then

0 commit comments

Comments
 (0)