aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/denote/cmd.lua18
1 files 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,