diff options
| author | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:40:42 +0100 |
|---|---|---|
| committer | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:40:42 +0100 |
| commit | 9fb27f9c4f8258662b5642d0768c60f4b870bca2 (patch) | |
| tree | 04deaf7484f351fcb1663f1a64c71dde72d81c3c /lua/denote | |
| parent | 672d8efde6808e428827bfb21586bf769f8248ad (diff) | |
| download | simple-denote.nvim-9fb27f9c4f8258662b5642d0768c60f4b870bca2.tar.gz | |
Maybe fixed error with lazy.nvim
Diffstat (limited to 'lua/denote')
| -rw-r--r-- | lua/denote/api.lua | 7 | ||||
| -rw-r--r-- | lua/denote/cmd.lua | 33 | ||||
| -rw-r--r-- | lua/denote/init.lua | 13 |
3 files changed, 30 insertions, 23 deletions
diff --git a/lua/denote/api.lua b/lua/denote/api.lua index cf26042..b01cdfa 100644 --- a/lua/denote/api.lua +++ b/lua/denote/api.lua @@ -64,11 +64,4 @@ function M.search() end end ----@param config DenoteConfig -function M.setup(config) - if config then - internal.config = config - end -end - return M diff --git a/lua/denote/cmd.lua b/lua/denote/cmd.lua index 9359a2f..aa93637 100644 --- a/lua/denote/cmd.lua +++ b/lua/denote/cmd.lua @@ -1,16 +1,21 @@ +local M = {} local api = require("denote.api") -vim.api.nvim_create_user_command("Denote", function(opts) - if opts.fargs[1] == "note" then - api.note() - elseif opts.fargs[1] == "search" then - api.search() - else - error("Unsupported operation " .. opts.fargs[1]) - end -end, { - nargs = 1, - complete = function() - return { "note", "search" } - end, -}) +function M.load_cmd() + vim.api.nvim_create_user_command("Denote", function(opts) + if opts.fargs[1] == "note" then + api.note() + elseif opts.fargs[1] == "search" then + api.search() + else + error("Unsupported operation " .. opts.fargs[1]) + end + end, { + nargs = 1, + complete = function() + return { "note", "search" } + end, + }) +end + +return M diff --git a/lua/denote/init.lua b/lua/denote/init.lua index 5d7528b..c18300d 100644 --- a/lua/denote/init.lua +++ b/lua/denote/init.lua @@ -1,4 +1,13 @@ -local M = require("denote.api") -require("denote.cmd") +local M = {} +local api = require("denote.api") +local cmd = require("denote.cmd") + +---@param config DenoteConfig +function M.setup(config) + cmd.load_cmd() + if config then + internal.config = config + end +end return M |
