aboutsummaryrefslogtreecommitdiff
path: root/lua/cmake-explorer/utils.lua
diff options
context:
space:
mode:
authorDaniil Rozanov <daniilrozzanov@gmail.com>2024-03-14 23:42:56 +0300
committerDaniil Rozanov <daniilrozzanov@gmail.com>2024-03-14 23:42:56 +0300
commitd36594025727d32b6580f188a4c0476aaeecfd77 (patch)
treeb9f7d1f8942e93b7f75fb1391dc9060332cb4f41 /lua/cmake-explorer/utils.lua
parenta60cc7fcc6375350e9f7720d0ae095aed7f24b67 (diff)
feat: initial ability to configure
Diffstat (limited to 'lua/cmake-explorer/utils.lua')
-rw-r--r--lua/cmake-explorer/utils.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/lua/cmake-explorer/utils.lua b/lua/cmake-explorer/utils.lua
new file mode 100644
index 0000000..8fff940
--- /dev/null
+++ b/lua/cmake-explorer/utils.lua
@@ -0,0 +1,25 @@
+local utils = {
+ plugin_prefix = "CM",
+}
+
+function utils.with_prefix(command)
+ return utils.plugin_prefix .. command
+end
+
+function utils.has_value(tab, val)
+ for index, value in ipairs(tab) do
+ if type(val) == "function" then
+ if val(value) then
+ return true
+ end
+ else
+ if value == val then
+ return true
+ end
+ end
+ end
+
+ return false
+end
+
+return utils