Skip to content

Commit 3186ac3

Browse files
Fix agenda todo only tags view. Closes #349
1 parent d3b95d2 commit 3186ac3

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

lua/orgmode/agenda/views/tags.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,15 @@ function AgendaTagsView:new(opts)
3232
return data
3333
end
3434

35-
function AgendaTagsView:build(opts)
36-
opts = opts or {}
37-
local tags = opts.tags
38-
39-
if not tags then
40-
tags = vim.fn.OrgmodeInput('Match: ', self.search, Files.autocomplete_tags)
41-
end
35+
function AgendaTagsView:build()
36+
local tags = vim.fn.OrgmodeInput('Match: ', self.search, Files.autocomplete_tags)
4237
if vim.trim(tags) == '' then
4338
return utils.echo_warning('Invalid tag.')
4439
end
4540
local search = Search:new(tags)
4641
self.items = {}
4742
for _, orgfile in ipairs(Files.all()) do
48-
local headlines_filtered = orgfile:apply_search(search, opts.todo_only)
43+
local headlines_filtered = orgfile:apply_search(search, self.todo_only)
4944
for _, headline in ipairs(headlines_filtered) do
5045
if self.filters:matches(headline) then
5146
table.insert(self.items, headline)

tests/plenary/colors/colors_spec.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ describe('Colors', function()
1515
it('should get appropriate fg color from hl group', function()
1616
vim.cmd([[hi OrgTestParse guifg=#FF0000]])
1717
local parsed_color = colors.parse_hl_fg_color('OrgTestParse')
18-
assert.are.same('#FF0000', parsed_color)
18+
assert.are.same('#FF0000', parsed_color:upper())
1919

2020
vim.cmd([[hi OrgTestParse guibg=#FF8888]])
2121
parsed_color = colors.parse_hl_fg_color('OrgTestParse')
22-
assert.are.same('#FF8888', parsed_color)
22+
assert.are.same('#FF8888', parsed_color:upper())
2323

2424
vim.cmd([[hi OrgTestParse guifg=#FFFFFF guibg=#00FF00]])
2525
parsed_color = colors.parse_hl_fg_color('OrgTestParse')
26-
assert.are.same('#00FF00', parsed_color)
26+
assert.are.same('#00FF00', parsed_color:upper())
2727

2828
vim.cmd([[hi OrgTestParse guifg=#FFFFFF guibg=#00FF00 gui=reverse]])
2929
parsed_color = colors.parse_hl_fg_color('OrgTestParse')
30-
assert.are.same('#FFFFFF', parsed_color)
30+
assert.are.same('#FFFFFF', parsed_color:upper())
3131

3232
vim.cmd([[hi clear OrgTestParse]])
3333
end)
@@ -52,7 +52,7 @@ describe('Colors', function()
5252

5353
it('should parse todo keyword faces', function()
5454
local get_color_opt = function(hlgroup, name, type)
55-
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(hlgroup)), name, type)
55+
return vim.fn.synIDattr(vim.fn.synIDtrans(vim.fn.hlID(hlgroup)), name, type):lower()
5656
end
5757
config:extend({
5858
org_todo_keyword_faces = {

0 commit comments

Comments
 (0)