Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update orgmode db on roam node creation #64

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lua/org-roam/database/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,14 @@ function M:load_file(opts)
insert_new_file_into_database(db, file, {
force = opts.force or file.metadata.changedtick ~= changedtick,
})

-- To allow a newly created roam file to be accessible for refiling and other
-- convenience features of orgmode, it must be add to the orgmode database.
-- Although it might be expected, that files:add_to_paths already does that,
-- this is currently not the case.
-- So the next line is a workaround to achieve this goal. Some rework at orgmodes
-- file-loading is to be expected and when it's done, this line can be removed.
require("orgmode").files:add_to_paths(file.filename)
end

resolve({
Expand Down