Skip to content

Commit

Permalink
fix: update orgmode db on roam node creation
Browse files Browse the repository at this point in the history
To make a new roam node accessible for refiling, searching and agenda
the org files need to be loaded again.
  • Loading branch information
Sebastian Flügge committed Sep 21, 2024
1 parent 192732a commit 73b8474
Showing 1 changed file with 8 additions and 0 deletions.
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 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:load(true)
end

resolve({
Expand Down

0 comments on commit 73b8474

Please sign in to comment.