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

Automatically close the aerial window when the corresponding buffer is closed #90

Closed
krishnakumarg1984 opened this issue May 1, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@krishnakumarg1984
Copy link

krishnakumarg1984 commented May 1, 2022

Description
Let's say we open a buffer with some symbols and use aerial to open the symbol tree. When we close the original buffer (e.g. through :bwipeout, :bdelete, <C-W> + c etc, the aerial window should also close. For instance, it is expected that the aerial window shall auto-close when the last valid file/buffer is closed, and can be mildly surprising when just the aerial window persists as the last open buffer.

Currently, the aerial window is left orphaned, pointing to dangling symbols which lead to a bunch of error lines when trying to open.

E5108: Error executing lua ...te/pack/packer/opt/aerial.nvim/lua/aerial/navigation.lua:175: Could not find destination window
stack traceback:
	[C]: in function 'error'
	...te/pack/packer/opt/aerial.nvim/lua/aerial/navigation.lua:175: in function 'select'
	...vim/site/pack/packer/opt/aerial.nvim/lua/aerial/init.lua:92: in function 'select'
	[string ":lua"]:1: in main chunk

System information

  • OS: Linux
  • Neovim version: 0.7
  • AerialInfo:
  • Aerial Info
-----------
Filetype: lua
Configured backends:
  lsp (not supported) [LSP client not attached]
  treesitter (supported) (attached)
  markdown (not supported) [Filetype is not markdown]
Show symbols: Array, Boolean, Class, Constant, Constructor, Enum, EnumMember, Event, Field, File, Function, Interface, Key, Method, Module, Namespace, Null, Number, Object, Operator, Package, Property, String, Struct, TypeParameter, Variable
  • Aerial config: N/A. Issue cccurs in the default config as well.

To Reproduce
Steps to reproduce the behavior:

  1. Open any file with suitable symbols (functions, classes etc). e.g. a Lua config file for neovim
  2. Toggle the symbols outline window with :AerialToggle<CR>
  3. Close the original file with :q (or ZZ, ZQ etc). The aerial window alone will persist.

Screenshots
image

After :q, we are left with
image

And pressing <CR> on any of the symbols in the tree results in an error:
image

@stevearc
Copy link
Owner

stevearc commented May 2, 2022

This is something that used to work, but must have regressed at some point. Should be fixed now

@krishnakumarg1984
Copy link
Author

Thank you. Indeed it works now. For robustness, is it worth adding a regression test for this issue?

@stevearc
Copy link
Owner

stevearc commented May 4, 2022

It would be nice to have, but would take some time and I have other tasks (in general, but also on aerial) that I think are higher priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants