diff --git a/lua/modules/utils/dap.lua b/lua/modules/utils/dap.lua index 44acb3f61..b98fa3aa2 100644 --- a/lua/modules/utils/dap.lua +++ b/lua/modules/utils/dap.lua @@ -1,26 +1,28 @@ local M = {} function M.input_args() - return function() - local argument_string = vim.fn.input("Program arg(s) (enter nothing to leave it null): ") - return vim.fn.split(argument_string, " ", true) - end + local argument_string = vim.fn.input("Program arg(s) (enter nothing to leave it null): ") + return vim.fn.split(argument_string, " ", true) end function M.input_exec_path() - return function() - return vim.fn.input('Path to executable (default to "progout"): ', vim.fn.getcwd() .. "/progout", "file") - end + return vim.fn.input('Path to executable (default to "progout"): ', vim.fn.getcwd() .. "/progout", "file") end function M.get_env() - return function() - local variables = {} - for k, v in pairs(vim.fn.environ()) do - table.insert(variables, string.format("%s=%s", k, v)) - end - return variables + local variables = {} + for k, v in pairs(vim.fn.environ()) do + table.insert(variables, string.format("%s=%s", k, v)) end + return variables end -return M +return setmetatable({}, { + __index = function(_, key) + return function() + return function() + return M[key]() + end + end + end, +})