Skip to content

Commit d17d1bb

Browse files
committed
Don't switch away from REPL on stopped event; Fix close/wipe handling in widgets
Follow up to #982
1 parent 3bde6f7 commit d17d1bb

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lua/dap/session.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,10 @@ end
375375
local function set_cursor(win, line, column)
376376
local ok, err = pcall(api.nvim_win_set_cursor, win, { line, column - 1 })
377377
if ok then
378-
api.nvim_set_current_win(win)
378+
local curbuf = api.nvim_get_current_buf()
379+
if vim.bo[curbuf].filetype ~= "dap-repl" then
380+
api.nvim_set_current_win(win)
381+
end
379382
api.nvim_win_call(win, function()
380383
api.nvim_command('normal! zv')
381384
end)

lua/dap/ui/widgets.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ M.frames = {
235235
label = "Jump to frame",
236236
fn = function(_, frame)
237237
if session then
238+
local close = vim.bo.bufhidden == "wipe"
238239
session:_frame_set(frame)
239-
if vim.bo.bufhidden == 'wipe' then
240+
if close then
240241
view.close()
241242
end
242243
else
@@ -284,11 +285,12 @@ M.sessions = {
284285
{
285286
label = "Focus session",
286287
fn = function(_, s)
288+
local close = vim.bo.bufhidden == "wipe"
287289
if s then
288290
dap.set_session(s)
289291
view.refresh()
290292
end
291-
if vim.bo.bufhidden == 'wipe' then
293+
if close then
292294
view.close()
293295
end
294296
end

0 commit comments

Comments
 (0)