3636M .open_term_buf_win = function ()
3737 -- When (re)opening the terminal we should NOT close it,
3838 -- since it's the default standard output for most adapters
39- -- Therefore, closing it could delete useful information from past sessions
39+ -- Therefore, closing it could delete useful information from the last session
4040
41- if term_bufnr == nil then
41+ if not term_bufnr then
4242 term_bufnr = api .nvim_create_buf (true , false )
4343
4444 assert (term_bufnr ~= 0 , " Failed to create nvim-dap-view buffer" )
@@ -48,19 +48,15 @@ M.open_term_buf_win = function()
4848
4949 local config = setup .config
5050
51- if term_winnr == nil then
52- for _ , adapter in ipairs (config .terminal .exclude_adapters ) do
53- dap .defaults [adapter ].terminal_win_cmd = function (session )
54- state .last_active_adapter = session .type
55-
51+ if not term_winnr then
52+ for _ , adapter in ipairs (config .windows .terminal .hide ) do
53+ dap .defaults [adapter ].terminal_win_cmd = function ()
5654 return term_bufnr
5755 end
5856 end
5957
60- dap .defaults .fallback .terminal_win_cmd = function (session )
61- state .last_active_adapter = session .type
62-
63- local is_win_valid = state .winnr ~= nil and api .nvim_win_is_valid (state .winnr ) or false
58+ dap .defaults .fallback .terminal_win_cmd = function ()
59+ local is_win_valid = state .winnr ~= nil and api .nvim_win_is_valid (state .winnr )
6460 term_winnr = api .nvim_open_win (term_bufnr , false , {
6561 split = is_win_valid and " left" or " below" ,
6662 win = is_win_valid and state .winnr or - 1 ,
0 commit comments