Skip to content
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

fix: ensure floating popup windows are auto closed when they lose focus #592

Merged
merged 2 commits into from
Jul 15, 2023

Conversation

PriceHiller
Copy link
Contributor

Prior to this commit any floating windows that lost focus were not closed and covered the editor as well as being inaccessible in that state.

This commit ensures the window is properly cleaned up when it loses focus. This only applies to floating windows.

See #591 for more details.

Closes #591

lua/neogit/lib/popup.lua Outdated Show resolved Hide resolved
@PriceHiller PriceHiller force-pushed the fix/popup-floating-focus-lost branch from 55b3b9d to e3305a2 Compare July 14, 2023 22:58
@PriceHiller PriceHiller force-pushed the fix/popup-floating-focus-lost branch from e3305a2 to 920b347 Compare July 14, 2023 22:59
@CKolkey
Copy link
Member

CKolkey commented Jul 15, 2023

Cool! But the buffer's #create function can take an autocmds key, like

- I think this could probably take advantage of that, no?

@PriceHiller
Copy link
Contributor Author

PriceHiller commented Jul 15, 2023

All of what was here previously were lies.

I was stuck back a few weeks on nightly 😔

@PriceHiller
Copy link
Contributor Author

PriceHiller commented Jul 15, 2023

That should do it.
I'm creating all the options in a separate table first so I can conditionally create the winleave autocmd (as we only want it affecting floating windows) then calling Buffer.create against that table.

Only working in one of my terms, not all.

Resolved.

lua/neogit/lib/popup.lua Outdated Show resolved Hide resolved
@CKolkey CKolkey merged commit 160d0cc into NeogitOrg:master Jul 15, 2023
3 checks passed
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.

Moving cursor out of a floating popup leaves the popup inaccessible
3 participants