aboutsummaryrefslogtreecommitdiff
path: root/lua/simple-denote/util.lua
diff options
context:
space:
mode:
authorDefaultGen <gravel.justness270@slmail.me>2024-06-04 17:13:32 -0400
committerDefaultGen <gravel.justness270@slmail.me>2024-06-04 17:13:32 -0400
commit9831fe1ec019e07251b209e73b3258d082d0ac94 (patch)
treea2443690eebb4e4a162b578f24588196f138be7c /lua/simple-denote/util.lua
parent45c6c2c12f97f91d0550db2aa888f68f68116e9a (diff)
downloadsimple-denote.nvim-9831fe1ec019e07251b209e73b3258d082d0ac94.tar.gz
Refactoring, fixing edge cases
Diffstat (limited to 'lua/simple-denote/util.lua')
-rw-r--r--lua/simple-denote/util.lua42
1 files changed, 0 insertions, 42 deletions
diff --git a/lua/simple-denote/util.lua b/lua/simple-denote/util.lua
deleted file mode 100644
index 7c01449..0000000
--- a/lua/simple-denote/util.lua
+++ /dev/null
@@ -1,42 +0,0 @@
-local M = {}
-
-
-function M.splitspace(str)
- local chunks = {}
- for substring in str:gmatch("%S+") do
- table.insert(chunks, #chunks, substring)
- end
- return chunks
-end
-
-function M.splitstring(str, delim)
- local items = {}
- local fulldelim = nil
- if delim == "." or delim == "-" then
- fulldelim = "%" .. delim
- else
- fulldelim = delim
- end
- str = str .. delim
- for w in str:gmatch("(.-)" .. fulldelim) do
- items[#items + 1] = w
- end
- return items
-end
-
---- Trim whitespace on either end of string
-function M.trim(str)
- local from = str:match"^%s*()"
- return from > #str and "" or str:match(".*%S", from)
-end
-
---- Remove special chars, make lowercase, spaces to dashes
-function M.plain_format(str)
- str = str:lower()
- str = str:gsub("[^%w%s]","")
- str = M.trim(str)
- str = str:gsub("%s+","-")
- return str
-end
-
-return M