rcarriga / nvim-dap-ui

A UI for nvim-dap
MIT License
2.69k stars 101 forks source link

Resizing other buffers on close #260

Open patrickarmengol opened 1 year ago

patrickarmengol commented 1 year ago

Forgive me in advance if this issue is not specific to nvim-dap-ui, but it is the only plugin I've observed exhibiting this behavior and I'm not sure how to fix it.

When closing nvim-dap-ui, other buffers are resized to include the area that nvim-dap-ui occupied. This issue is kind of like the opposite of https://github.com/rcarriga/nvim-dap-ui/issues/175

This occurs only on close, not on toggle. It also only seems to affect other plugin panes like neo-tree.nvim, toggleterm.nvim, and aerial.nvim; regular editor buffer splits stay in tact. It affects both horizontal and vertical dimensions.

Passing { reset = true } to open/close does not fix it.

Here are some example screenshots:

screenshot1 screenshot2 screenshot3

rcarriga commented 1 year ago

Can you try setting winfixwidth and winfixheight on the neo-tree window?

patrickarmengol commented 1 year ago

Can you try setting winfixwidth and winfixheight on the neo-tree window?

No change in behavior.

chaozwn commented 1 year ago

Can you try setting winfixwidth and winfixheight on the neo-tree window?

No change in behavior.

Has the problem been solved?

patrickarmengol commented 1 year ago

Has the problem been solved?

No, it's still occurring.

patricio-ferraggi-deel commented 1 year ago

this happens to me too, it happens with every plugin I open on the side, nvim-tree, neotree, neotest summary.

HugoxSaraiva commented 1 year ago

Happens with me too

HugoxSaraiva commented 1 year ago

Hi @patrickarmengol, can you try doing what was described in #122 ? I think I had the same issue you had, and the config described there solved my issue. Be sure to use the latter code example, because it looks like the first example works when you open the dap ui for the first time, but crashes on the second try.

sewbacca commented 5 months ago

For me at least, the fix described there doesn't work.

I found a partial workarround though: Instead of dapui.open / dapui.close, call dapui.toggle. This somehow fixes the issue.

local dap = require 'dap'
local dapui = require 'dapui'

vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })

dap.listeners.before.attach.dapui_config = dapui.toggle
dap.listeners.after.event_initialized["dapui_config"] = dapui.toggle
dap.listeners.before.event_terminated["dapui_config"] = dapui.toggle
dap.listeners.before.event_exited["dapui_config"] = dapui.toggle

The drawback is of course, that if you toggle the dapui during a session, you'll, get the ui thrown back at you.

ixpectus commented 4 months ago

Happens with me too