diff options
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 |
