aboutsummaryrefslogtreecommitdiff
path: root/lua/denote/cmd.lua
diff options
context:
space:
mode:
authorHumanEntity <human_entity@icloud.com>2023-12-25 12:40:42 +0100
committerHumanEntity <human_entity@icloud.com>2023-12-25 12:40:42 +0100
commit9fb27f9c4f8258662b5642d0768c60f4b870bca2 (patch)
tree04deaf7484f351fcb1663f1a64c71dde72d81c3c /lua/denote/cmd.lua
parent672d8efde6808e428827bfb21586bf769f8248ad (diff)
downloadsimple-denote.nvim-9fb27f9c4f8258662b5642d0768c60f4b870bca2.tar.gz
Maybe fixed error with lazy.nvim
Diffstat (limited to 'lua/denote/cmd.lua')
-rw-r--r--lua/denote/cmd.lua33
1 files changed, 19 insertions, 14 deletions
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