We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d56a6e2 commit 299f922Copy full SHA for 299f922
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