We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent c8812de commit 828c4b5Copy full SHA for 828c4b5
lua/orgmode/attach/core.lua
@@ -308,7 +308,13 @@ end
308
function AttachCore:unset_directory(node, opts)
309
local old_dir = self:get_dir(node, true)
310
node:set_dir()
311
- local new_dir = self:get_dir(node, true) -- new dir potentially via parent nodes
+ -- After removal, there might be a new DIR directory via inheritance.
312
+ local new_dir = self:get_dir_or_nil(node, true)
313
+ if not new_dir then
314
+ -- There is no parent node with a DIR property. Switch back to ID-based
315
+ -- directory.
316
+ new_dir = node:id_dir_get_or_create()
317
+ end
318
-- Ordering matters here: both `opts` should be evaluated before the
319
-- operations (copy if desired, delete if desired) start.
320
---@param do_copy? boolean
0 commit comments