From 92e8b513d1278f5c6b32dae7fbef95a11871a609 Mon Sep 17 00:00:00 2001 From: Karolis Pabijanskas Date: Tue, 17 Dec 2024 16:49:41 +0200 Subject: [PATCH] fix: retain direct tags even if they are excluded from inheritance (#839) If a tag is excluded from inheritance, then it gets excluded even from headlines that have it assigned directly. This is most noticable when searching in agenda view. This PR fixes it - you can now search by tags that are excluded from inheritance. Fixes #830 --- lua/orgmode/files/headline.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/orgmode/files/headline.lua b/lua/orgmode/files/headline.lua index b6c1d9c6..c008dd2a 100644 --- a/lua/orgmode/files/headline.lua +++ b/lua/orgmode/files/headline.lua @@ -556,9 +556,10 @@ function Headline:get_tags() local all_tags = utils.concat({}, file_tags) utils.concat(all_tags, utils.reverse(parent_tags), true) + all_tags = config:exclude_tags(all_tags) utils.concat(all_tags, tags, true) - return config:exclude_tags(all_tags), own_tags_node + return all_tags, own_tags_node end ---@return OrgHeadline | nil