Skip to content

Commit 0fc730b

Browse files
committed
fix: closing the REPL may be necessary
When switching tabs, we have to call `repl.close` manually for some reason. Otherwise keeps the functionality of closing / keeping the contents.
1 parent 25d8ef1 commit 0fc730b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/dap-view/actions.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
local dap = require("dap")
2+
13
local winbar = require("dap-view.options.winbar")
24
local setup = require("dap-view.setup")
35
local autocmd = require("dap-view.options.autocmd")
@@ -20,6 +22,9 @@ end
2022

2123
---@param hide_terminal? boolean
2224
M.close = function(hide_terminal)
25+
if state.current_section == "repl" then
26+
dap.repl.close({ mode = "toggle" })
27+
end
2328
if state.winnr and api.nvim_win_is_valid(state.winnr) then
2429
api.nvim_win_close(state.winnr, true)
2530
end

0 commit comments

Comments
 (0)