From 01c0c3b0eb796bcd293b7f97629ddd3889d0c02a Mon Sep 17 00:00:00 2001 From: HumanEntity Date: Mon, 25 Dec 2023 14:16:39 +0100 Subject: Added tag searching functionality --- lua/denote/util.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lua/denote/util.lua') diff --git a/lua/denote/util.lua b/lua/denote/util.lua index ce998f0..bd237eb 100644 --- a/lua/denote/util.lua +++ b/lua/denote/util.lua @@ -8,4 +8,20 @@ function M.splitspace(str) return chunks end +function M.splitstring(str, delim) + local items = {} + local fulldelim = nil + if delim == "." or delim == "-" then + fulldelim = "%" .. delim + else + fulldelim = delim + end + print("fulldelim: ", fulldelim) + str = str .. delim + for w in str:gmatch("(.-)" .. fulldelim) do + items[#items + 1] = w + end + return items +end + return M -- cgit v1.2.3