folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
783 stars 14 forks source link

fix: update edgebars on BufWinEnter #47

Closed willothy closed 9 months ago

willothy commented 10 months ago

problem: When switching buffers to a buffer of the same filetype in an edgy window, the view is not updated and the winbar does not appear.

solution: Update edgebars on BufWinEnter.

folke commented 9 months ago

Thanks!

willothy commented 9 months ago

Thanks for all your work!

folke commented 9 months ago

I just reverted this change since edgebars are now re-layout whenever you chnage the current buffer, which is not great.

What was the exact problem you wanted to solve here?

Can you give me step by step how to reproduce and what didnt work?

willothy commented 9 months ago

Sure, no worries :) Essentially, I use dropbar.nvim along with toggleterm and edgy for managing terminals. The issue is that when I switch between terminals in the edgy window, the winbar disappears so I'm unable to open the popup and switch back using my regular mappings.

Here's a video:

https://github.com/folke/edgy.nvim/assets/38540736/3c685acd-f94e-427e-ba47-766abe9f2c4b

willothy commented 9 months ago

I was actually just about to look into a better solution for this, sorry I should've updated but didn't know you were about to merge haha. Maybe a single BufWinEnter autocmd that updates only the view that changed would work? The layout doesn't actually nee to be recomputed, the view just needs to be updated.

willothy commented 9 months ago

I was actually just about to look into a better solution for this, sorry I should've updated but didn't know you were about to merge haha. Maybe a single BufWinEnter autocmd that updates only the view that changed would work? The layout doesn't actually nee to be recomputed, the view just needs to be updated.

willothy commented 9 months ago

Found the cause! When switching buffers in the edgy window, the window id that is passed to the winbar changes to an id that is not correct. It doesn't seem to be invalid as there are no errors, but it is not the id of the current window. Looking into it now.

willothy commented 9 months ago

I have come up with a much simpler solution in #55 since I was able to find out what the actual issue was :)

Sorry about the initial PR, should have looked deeper before submitting that.