From d36594025727d32b6580f188a4c0476aaeecfd77 Mon Sep 17 00:00:00 2001 From: Daniil Rozanov Date: Thu, 14 Mar 2024 23:42:56 +0300 Subject: feat: initial ability to configure --- lua/cmake-explorer/utils.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 lua/cmake-explorer/utils.lua (limited to 'lua/cmake-explorer/utils.lua') 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 -- cgit v1.2.3