From c133bb9f3dffeea59c813f746040eb4c62388fc2 Mon Sep 17 00:00:00 2001 From: HumanEntity Date: Mon, 25 Dec 2023 12:58:10 +0100 Subject: Fixed cmd --- lua/denote/cmd.lua | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lua/denote/cmd.lua b/lua/denote/cmd.lua index 9b8d9e6..6489f0c 100644 --- a/lua/denote/cmd.lua +++ b/lua/denote/cmd.lua @@ -5,21 +5,15 @@ local api = require("denote.api") function M.load_cmd() vim.api.nvim_create_user_command("Denote", function(opts) - if opts.fargs[1] then - if opts.fargs[1] == "note" then - api.note() - elseif opts.fargs[1] == "search" then - api.search() - else - error("Unsupported operation " .. opts.fargs[1]) - end + if opts.fargs[1] == "note" then + api.note() + elseif opts.fargs[1] == "search" then + api.search() else - vim.ui.select(M.commands, { prompt = "Command: " }, function(choice) - api[choice]() - end) + error("Unsupported operation " .. opts.fargs[1]) end end, { - -- nargs = 1, + nargs = 1, complete = function() return { "note", "search" } end, -- cgit v1.2.3