Skip to content

Commit 12ccdc0

Browse files
fix(files): Ignore directories ending in .org
Closes #714
1 parent 0035f03 commit 12ccdc0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/orgmode/files/init.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,14 @@ function OrgFiles:_files(skip_resolve)
352352

353353
return vim.tbl_filter(function(file)
354354
local ext = vim.fn.fnamemodify(file, ':e')
355-
return ext == 'org' or ext == 'org_archive'
355+
local is_org = ext == 'org' or ext == 'org_archive'
356+
357+
if not is_org then
358+
return false
359+
end
360+
361+
local stat = vim.loop.fs_stat(file)
362+
return stat and stat.type == 'file' or false
356363
end, all_files)
357364
end
358365

0 commit comments

Comments
 (0)