fix(dap): use dap's splitstr when running with args. Closes #4387

This commit is contained in:
Folke Lemaitre 2024-11-08 13:31:16 +01:00
parent ee2ec7e474
commit 776994a207
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040

View file

@ -6,12 +6,12 @@ local function get_args(config)
config = vim.deepcopy(config) config = vim.deepcopy(config)
---@cast args string[] ---@cast args string[]
config.args = function() config.args = function()
local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) local new_args = vim.fn.expand(vim.fn.input("Run with args: ", args_str)) --[[@as string]]
if config.type and config.type == "java" then if config.type and config.type == "java" then
---@diagnostic disable-next-line: return-type-mismatch ---@diagnostic disable-next-line: return-type-mismatch
return new_args return new_args
end end
return vim.split(new_args, " ") return require("dap.utils").splitstr(new_args)
end end
return config return config
end end