aerial.nvim
aerial.nvim copied to clipboard
bug: Several bugs related to re-loading buffer with `:e`
Neovim version (nvim -v)
0.10.4 and nightly
Operating system/version
ubuntu 22.04
Output of :AerialInfo
Aerial Info
-----------
Filetype: markdown
Configured backends:
treesitter (supported) (attached)
lsp (not supported) [No LSP client found that supports symbols]
markdown (supported)
asciidoc (not supported) [Filetype is not asciidoc]
man (not supported) [Filetype is not man]
Show symbols: Class, Constructor, Enum, Function, Interface, Module, Method, Struct
Describe the bug
- Bug 1:
on_detachis not called when buffer is reloaded with:e. - Bug 2: Symbols are not refreshed when buffer is reloaded with
:e. - Bug 3: Positions are not refreshed when buffer is reloaded with
:e.
What is the severity of this bug?
minor (annoyance)
Steps To Reproduce
In all the following examples, use the following config file repro.lua and run nvim with nvim -u repro.lua README.md in the aerial repo.
vim.cmd[[set runtimepath+=.]]
local aerial = require'aerial'
aerial.setup {
on_attach = function(bufnr)
vim.keymap.set('n', '[[', aerial.prev, { buffer = bufnr })
vim.keymap.set('n', ']]', aerial.next, { buffer = bufnr })
end
}
Bug 1
nvim -u repro.lua README.md- Reload the buffer with
:e - Check that
[[and]]mappings are overwritten by builtin markdown ftplugin. It does move to headings, but it does not highlight them.
Bug 2
nvim -u repro.lua README.md:e:lua require'aerial'.next(). Note that it doesn't move the cursor, because aerials BufUnload autocmd clears the bufdata.
Bug 3
nvim -u repro.lua README.md]]twice. The cursor is now on the second heading.:au FileType * lua require('aerial').refetch_symbols():e:lua require'aerial'.next(). This moves the cursor to the first heading, instead of the third heading.
Expected Behavior
see above
Minimal example file
No response
Minimal init.lua
Additional context
No response