fix(picker.actions): ensure the current window is updated after tabdrop (#2326)

## Description

Update the winid (in the `win` variable) after `tab drop`.

## Related Issue(s)

Without this patch, when the user set `confirm` to `{ action =
"confirm", cmd = "tabdrop" }` and jump to a location in a different tab,
since the `win` is still pointing to the original window (tab), there'd
be a `Cursor position outside buffer` error.
This commit is contained in:
David 2025-10-23 15:09:24 +08:00 committed by GitHub
parent de2a8f94e5
commit b30121bfce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -89,6 +89,7 @@ function M.jump(picker, _, action)
drop[#drop + 1] = vim.fn.fnameescape(path)
end
vim.cmd(cmd .. " " .. table.concat(drop, " "))
win = vim.api.nvim_get_current_win()
else
for i, item in ipairs(items) do
-- load the buffer