Skip to content

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

@wookayin

Description

@wookayin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions