From 9fb27f9c4f8258662b5642d0768c60f4b870bca2 Mon Sep 17 00:00:00 2001 From: HumanEntity Date: Mon, 25 Dec 2023 12:40:42 +0100 Subject: Maybe fixed error with lazy.nvim --- lua/denote/cmd.lua | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'lua/denote/cmd.lua') 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 -- cgit v1.2.3