aboutsummaryrefslogtreecommitdiff
path: root/lua/denote/api.lua
diff options
context:
space:
mode:
authorHumanEntity <human_entity@icloud.com>2023-12-25 14:16:39 +0100
committerHumanEntity <human_entity@icloud.com>2023-12-25 14:16:39 +0100
commit01c0c3b0eb796bcd293b7f97629ddd3889d0c02a (patch)
treeee3f9fca46c15e73f5ac566d8affbac5b3653d5e /lua/denote/api.lua
parentb79f2707309c20f2834008b1ea0cfcad89ba3978 (diff)
downloadsimple-denote.nvim-01c0c3b0eb796bcd293b7f97629ddd3889d0c02a.tar.gz
Added tag searching functionality
Diffstat (limited to 'lua/denote/api.lua')
-rw-r--r--lua/denote/api.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/lua/denote/api.lua b/lua/denote/api.lua
index feecefe..7213f8c 100644
--- a/lua/denote/api.lua
+++ b/lua/denote/api.lua
@@ -29,7 +29,7 @@ end
---@param date DenoteDate|nil
---@param name string|nil
-function M.search(date, name)
+function M.search(date, name, tags)
if not date then
vim.ui.input({ prompt = "Date: " }, function(input)
local split = util.splitspace(input)
@@ -52,7 +52,13 @@ function M.search(date, name)
end)
end
- local status = internal.search(date, name, function(input)
+ if not tags then
+ vim.ui.input({ prompt = "Tags: " }, function(input)
+ tags = util.splitstring(input, " ")
+ end)
+ end
+
+ local status = internal.search(date, name, tags, function(input)
if input then
vim.cmd("e " .. config.vault.dir .. "/" .. input)
end