diff options
| author | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:58:10 +0100 |
|---|---|---|
| committer | HumanEntity <human_entity@icloud.com> | 2023-12-25 12:58:10 +0100 |
| commit | c133bb9f3dffeea59c813f746040eb4c62388fc2 (patch) | |
| tree | 690e2c94ec33703f33b51a7177ddaaa3bff61973 | |
| parent | 4997cc9704883b7833372386b71ddc8bbb177a56 (diff) | |
| download | simple-denote.nvim-c133bb9f3dffeea59c813f746040eb4c62388fc2.tar.gz | |
Fixed cmd
| -rw-r--r-- | lua/denote/cmd.lua | 18 |
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, |
