Skip to content

Commit 33c5a84

Browse files
committed
task
1 parent e84f2e0 commit 33c5a84

File tree

5 files changed

+18
-104
lines changed

5 files changed

+18
-104
lines changed

lua/down.lua

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Down.default = {
1818
-- ['lsp'] = {},
1919
['template'] = {},
2020
['mod'] = {},
21+
['task'] = {},
2122
['cmd'] = {},
2223
['link'] = {},
2324
['tool.telescope'] = {},

lua/down/mod/cmd/init.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ M.sync = function()
335335
end
336336
local lc = lm.commands
337337
for cn, c in pairs(lm.commands) do
338-
if c.enabled ~= false then
338+
if type(c) == 'table' and c.enabled ~= false then
339339
lc[cn] = c
340340
-- M.commands(mod_name)
341341
end

lua/down/mod/mod/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ local log = require 'down.util.log'
66
local M = mod.new 'mod'
77

88
M.commands = {
9-
-- enabled = false,
9+
enabled = true,
1010
mod = {
1111
enabled = true,
1212
name = 'mod',
@@ -89,8 +89,8 @@ M.commands = {
8989
},
9090
}
9191
M.maps = {
92-
{ 'n', ',dml', '<CMD>Down mod list<CR>', 'List mods' },
93-
{ 'n', ',dmL', '<CMD>Down mod load<CR>', 'Load mod' },
92+
{ 'n', ',dml', '<CMD>Down mod list<CR>', 'List mods' },
93+
{ 'n', ',dmL', '<CMD>Down mod load<CR>', 'Load mod' },
9494
{ 'n', ',dmu', '<CMD>Down mod unload<CR>', 'Unload mod' },
9595
}
9696
M.setup = function()

lua/down/mod/task/init.lua

+13-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ local mod = require 'down.mod'
22
local log = require 'down.util.log'
33

44
---@class down.mod.Task: down.Mod
5-
local M = mod.new('task', {
6-
'agenda',
7-
})
5+
local M = mod.new('task')
86

97
---@class down.mod.task.Task
108
M.Task = {
@@ -33,6 +31,7 @@ M.config = {
3331
}
3432

3533
M.commands = {
34+
enabled = false,
3635
task = {
3736
name = 'task',
3837
args = 0,
@@ -107,12 +106,22 @@ M.setup = function()
107106
'cmd',
108107
'ui.calendar',
109108
'data.store',
110-
'data.task.agenda',
109+
-- 'data.task.agenda',
111110
},
112111
loaded = true,
113112
}
114113
end
115114

115+
function M.toggle()
116+
local line = vim.api.nvim_get_current_line()
117+
if line:match('%[ %]') then
118+
line = line:gsub('%[ %]', '[x]')
119+
elseif line:match('%[x%]') then
120+
line = line:gsub('%[x%]', '[ ]')
121+
end
122+
vim.api.nvim_set_current_line(line)
123+
end
124+
116125
-- M.handle = {
117126
-- cmd = {
118127
-- ['task.list'] = function()

lua/init.lua

-96
This file was deleted.

0 commit comments

Comments
 (0)