Skip to content

Commit

Permalink
Change widget/repl toggle to close and re-open if in was on other tab…
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
mfussenegger committed Nov 13, 2024
1 parent 8517126 commit 6bf4de6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/dap/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,11 @@ function M.new_view(new_buf, new_win, opts)
local win = self.win
local buf = self.buf
if win and api.nvim_win_is_valid(win) and api.nvim_win_get_buf(win) == buf then
local win_tabpage = api.nvim_win_get_tabpage(win)
local current_tabpage = api.nvim_get_current_tabpage()
api.nvim_win_close(win, true)
self.win = nil
closed = true
closed = win_tabpage == current_tabpage
end
local hide = close_opts.mode == 'toggle'
if buf and not hide then
Expand Down

2 comments on commit 6bf4de6

@igorlfs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello! I'm not sure if that's the intended behavior after this change, but since I open the REPL in a new tab (via tab split), I now have to move to the tab with the REPL to actually close it. Is there a workaround to restore previous behavior, where the REPL would be toggled regardless of its tab?

@mfussenegger
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize people were using it that way. I reverted the commit now.

Please sign in to comment.