aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorVolodymyr Chernetskyi <volodymyr_chernetskyi@goodyear.com>2026-09-24 20:26:17 +0200
committerGitHub <noreply@github.com>2026-09-24 14:26:17 -0400
commit8aae4c104640bc4fd17fd51b2eb41efe7ee460cd (patch)
treee30820e764e2282e3eef3a58ab9ba43b737495d4 /runtime
parentebc4f234c28d2308d2ed049d2bbcb3c9d44ad3da (diff)
downloadrneovim-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.lua2
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