diff options
| author | Volodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com> | 2026-09-24 20:26:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-24 14:26:17 -0400 |
| commit | 8aae4c104640bc4fd17fd51b2eb41efe7ee460cd (patch) | |
| tree | e30820e764e2282e3eef3a58ab9ba43b737495d4 /runtime | |
| parent | ebc4f234c28d2308d2ed049d2bbcb3c9d44ad3da (diff) | |
| download | rneovim-8aae4c104640bc4fd17fd51b2eb41efe7ee460cd.tar.gz rneovim-8aae4c104640bc4fd17fd51b2eb41efe7ee460cd.tar.bz2 rneovim-8aae4c104640bc4fd17fd51b2eb41efe7ee460cd.zip | |
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.
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/lua/vim/ui.lua | 2 |
1 files changed, 1 insertions, 1 deletions
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 |