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