diff options
| author | HumanEntity <human_entity@icloud.com> | 2023-12-25 14:16:39 +0100 |
|---|---|---|
| committer | HumanEntity <human_entity@icloud.com> | 2023-12-25 14:16:39 +0100 |
| commit | 01c0c3b0eb796bcd293b7f97629ddd3889d0c02a (patch) | |
| tree | ee3f9fca46c15e73f5ac566d8affbac5b3653d5e /lua/denote/util.lua | |
| parent | b79f2707309c20f2834008b1ea0cfcad89ba3978 (diff) | |
| download | simple-denote.nvim-01c0c3b0eb796bcd293b7f97629ddd3889d0c02a.tar.gz | |
Added tag searching functionality
Diffstat (limited to 'lua/denote/util.lua')
| -rw-r--r-- | lua/denote/util.lua | 16 |
1 files changed, 16 insertions, 0 deletions
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 |
