@@ -4,7 +4,7 @@ local Search = require('orgmode.files.elements.search')
4
4
local OrgAgendaTodosType = require (' orgmode.agenda.types.todo' )
5
5
6
6
--- @class OrgAgendaTagsTypeOpts : OrgAgendaTodosTypeOpts
7
- --- @field search_query ? string
7
+ --- @field match_query ? string
8
8
9
9
--- @class OrgAgendaTagsType : OrgAgendaTodosType
10
10
local OrgAgendaTagsType = {}
@@ -14,29 +14,29 @@ OrgAgendaTagsType.__index = OrgAgendaTagsType
14
14
function OrgAgendaTagsType :new (opts )
15
15
opts .todo_only = opts .todo_only or false
16
16
opts .subheader = ' Press "r" to update search'
17
- local search_query = opts .search_query
18
- if not search_query or search_query == ' ' then
19
- search_query = self :get_tags (opts .files )
20
- if not search_query then
17
+ local match_query = opts .match_query
18
+ if not match_query or match_query == ' ' then
19
+ match_query = self :get_tags (opts .files )
20
+ if not match_query then
21
21
return nil
22
22
end
23
23
end
24
24
25
25
setmetatable (self , { __index = OrgAgendaTodosType })
26
26
local obj = OrgAgendaTodosType :new (opts )
27
27
setmetatable (obj , self )
28
- obj .search_query = search_query
29
- obj .header = ' Headlines with TAGS match: ' .. obj .search_query
28
+ obj .match_query = match_query
29
+ obj .header = ' Headlines with TAGS match: ' .. obj .match_query
30
30
return obj
31
31
end
32
32
33
33
function OrgAgendaTagsType :get_file_headlines (file )
34
- return file :apply_search (Search :new (self .search_query or ' ' ), self .todo_only )
34
+ return file :apply_search (Search :new (self .match_query or ' ' ), self .todo_only )
35
35
end
36
36
37
37
--- @param files ? OrgFiles
38
38
function OrgAgendaTagsType :get_tags (files )
39
- local tags = vim .fn .OrgmodeInput (' Match: ' , self .search_query or ' ' , function (arg_lead )
39
+ local tags = vim .fn .OrgmodeInput (' Match: ' , self .match_query or ' ' , function (arg_lead )
40
40
return utils .prompt_autocomplete (arg_lead , (files or self .files ):get_tags ())
41
41
end )
42
42
if vim .trim (tags ) == ' ' then
@@ -46,11 +46,12 @@ function OrgAgendaTagsType:get_tags(files)
46
46
end
47
47
48
48
function OrgAgendaTagsType :redo ()
49
+ -- Skip prompt for custom views
49
50
if self .is_custom then
50
51
return self
51
52
end
52
- self .search_query = self :get_tags () or ' '
53
- self .header = ' Headlines with TAGS match: ' .. self .search_query
53
+ self .match_query = self :get_tags () or ' '
54
+ self .header = ' Headlines with TAGS match: ' .. self .match_query
54
55
return self
55
56
end
56
57
0 commit comments