Skip to content

fix(#1545): dispatch Event.Resize on all window resizes, requires nvim 0.9+ #2238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 10, 2023

Conversation

alex-courtis
Copy link
Member

fixes #1545

@wlh320 @Tcholly I'd be most grateful if you tested this fix:

cd /path/to/nvim-tree.lua
git pull
git checkout 1545-resize-events

if vim.fn.has "nvim-0.9" == 1 then
create_nvim_tree_autocmd("WinResized", {
callback = function()
if vim.v.event and vim.v.event.windows then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if it makes any difference but fallback receives an event afair.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean the fallback in view.lua?

Sending multiple events would be undesirable...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean the fallback in view.lua?

Sending multiple events would be undesirable...

No, meant that you should be able to do

callback = function(event)

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course, I'll give that a go.

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately no. The v:event data is still not passed to the callback. I hope they add that at some point...

@alex-courtis
Copy link
Member Author

nudge @wlh320 @Tcholly

I'd be most grateful if you tested this fix:

cd /path/to/nvim-tree.lua
git pull
git checkout 1545-resize-events

@alex-courtis alex-courtis merged commit 0345117 into master Jun 10, 2023
@alex-courtis alex-courtis deleted the 1545-resize-events branch June 10, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resize event not dispatched when resizing using mouse
2 participants