diff options
author | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-03-14 23:42:56 +0300 |
---|---|---|
committer | Daniil Rozanov <daniilrozzanov@gmail.com> | 2024-03-14 23:42:56 +0300 |
commit | d36594025727d32b6580f188a4c0476aaeecfd77 (patch) | |
tree | b9f7d1f8942e93b7f75fb1391dc9060332cb4f41 /lua/cmake-explorer/utils.lua | |
parent | a60cc7fcc6375350e9f7720d0ae095aed7f24b67 (diff) |
feat: initial ability to configure
Diffstat (limited to 'lua/cmake-explorer/utils.lua')
-rw-r--r-- | lua/cmake-explorer/utils.lua | 25 |
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 |