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 0d4666f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/org-roam/database/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ function M:load_file(opts)
insert_new_file_into_database(db, file, {
force = opts.force or file.metadata.changedtick ~= changedtick,
})

-- This is a workaround to load the newly created org file into the orgmode
-- database, so it is possible to e.g. refile to it without restarting Neovim.
require("orgmode").files:load(true)
end

resolve({
Expand Down

0 comments on commit 0d4666f

Please sign in to comment.