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

Auto-close the info window, when closing the current buffer. #143

Merged
merged 1 commit into from
Mar 2, 2024

Conversation

silky
Copy link
Contributor

@silky silky commented Mar 2, 2024

This is an attempt to make vim close if you exit while the info window is open; feel free to suggest ideas/alternatives/etc, this is basically a draft, but it is working well for me.

Note that there is a bug, I suppose, that it actually closes all quickfix windows upon exiting a single buffer, which is not ideal, because maybe you have a different split with a buffer and an info window for that open; in which case exiting one buffer closes all info windows.

I suppose to fix that one would need to identify the present buffer and match them based on names.

Is that important enough to do? Does anyone else even want this functionality at all?

This was inspired by: https://github.com/nvim-tree/nvim-tree.lua/wiki/Auto-Close#ppwwyyxx but I didn't bother with the additional complication :)

Notes:

  • The command has to be Sync type, otherwise the present (last) buffer closes too fast and vim gets upset with E444: Cannot close last window.
  • I updated the readme to make this the default behaviour if people copy and paste the config; but maybe because of the above caveat we shouldn't have that; it should just be an option for people that are willing to live with the annoyance.

cc @googleson78 .

@isovector
Copy link
Collaborator

LGTM. Thanks!

@isovector isovector merged commit 9d83faa into agda:master Mar 2, 2024
16 checks passed
@silky silky deleted the auto-close-info-window branch March 2, 2024 17:27
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.

2 participants