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

Autoclose on BufLeave should be only when entering into a normal buffer #86

Open
wookayin opened this issue May 24, 2022 · 2 comments
Open

Comments

@wookayin
Copy link
Contributor

There is a BufLeave autocmd that will make the git-messenger popup window closed when the focus has moved to another window. However, the event is also triggered when there appears another pop-up window, like wilder.nvim, LSP status, vim.ui.input plugins, etc.

For example, I use wilder.nvim which implements wildmenu as a pop-up window; when pressing '/' (search) the git-messenger window will be automatically closed as soon as the pop-up window appears. This prevents me from doing search on the git-messenger buffer.

One solution would be to not use BufLeave <buffer> autocmd, but instead use other events (such as WinEnter) to determine if the user entered a "normal", non-floating buffer/window. FYI, nvim-lsp-installer implements this idea to make auto-closing behavior in the presence of other floating windows much more reasonable.

@rhysd
Copy link
Owner

rhysd commented Sep 20, 2022

It sounds hard what "normal" exactly means here.

@wookayin
Copy link
Contributor Author

wookayin commented Sep 20, 2022

I meant, by normal, a non-floating window (split windows). Sorry for the confusion. Do you have any other questions? If you have hard time getting my point, I can go out of my way to make some GIFs to show why the current behavior can be annoying and how it could be improved.

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

No branches or pull requests

2 participants