From 8aae4c104640bc4fd17fd51b2eb41efe7ee460cd Mon Sep 17 00:00:00 2001 From: Volodymyr Chernetskyi Date: Thu, 24 Sep 2026 20:26:17 +0200 Subject: fix(ui): ui.open() modifies opts.cmd #41885 Problem: ui.open() appends the path to the caller's opts.cmd, so reusing the opts opens previously supplied paths again. Solution: Copy opt.cmd before appending the path. --- runtime/lua/vim/ui.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/lua/vim/ui.lua b/runtime/lua/vim/ui.lua index 834749aa14..78af9bf153 100644 --- a/runtime/lua/vim/ui.lua +++ b/runtime/lua/vim/ui.lua @@ -189,7 +189,7 @@ function M.open(path, opt) local job_opt = { text = true, detach = true } --- @type vim.SystemOpts if opt.cmd then - cmd = vim.list_extend(opt.cmd --[[@as string[] ]], { path }) + cmd = vim.list_extend(vim.list_slice(opt.cmd) --[[@as string[] ]], { path }) else local open_cmd, err = M._get_open_cmd() if err then -- cgit