Skip to content

Commit fd4eaea

Browse files
jedrzejboczarmfussenegger
authored andcommitted
Fix incorrect cursor position when opening frame from dapui
1 parent 1798c75 commit fd4eaea

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lua/dap/session.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,10 +384,11 @@ end
384384

385385

386386
local function with_win(win, fn, ...)
387-
local cur_win = api.nvim_get_current_win()
388-
api.nvim_set_current_win(win)
389-
local ok, err = pcall(fn, ...)
390-
pcall(api.nvim_set_current_win, cur_win)
387+
local args = {...}
388+
local ok, err
389+
api.nvim_win_call(win, function()
390+
ok, err = pcall(fn, unpack(args))
391+
end)
391392
assert(ok, err)
392393
end
393394

0 commit comments

Comments
 (0)