Closed Zeioth closed 1 month ago
This means that the behavior would go back to not opening Aerial at all if you toggle it in the Neotree buffer. Is that a better situation than this one?
Another thing to look into: if you want aerial to stick to the right edge of your editor, you can set the options
require("aerial").setup({
layout = {
default_direction = "right",
placement = "edge",
}
})
Would that solve your issue?
@stevearc That solution works fine steve thank you:
layout = {
min_width = 28,
default_direction = "right",
placement = "edge",
},
I've focused neotree and opened aerial
It opens in the correct position, and once I click the code, aerial is populated correctly
It is still possible to fuck the UI when performing obscure actions such as
This is already better, but maybe I would still revert, or check that out. Up to you.
If I repeat that I can spawn infinite aerials
@Zeioth Try setting the attach_mode
as well
require("aerial").setup({
layout = {
default_direction = "right",
placement = "edge",
},
attach_mode = "global"
})
I had it already. Full config:
{
"stevearc/aerial.nvim",
event = "VeryLazy",
opts = {
ignore = {
buftypes = { "nofile" },
},
filter_kind = { -- Symbols that will appear on the tree
-- "Class",
"Constructor",
"Enum",
"Function",
"Interface",
-- "Module",
"Method",
-- "Struct",
},
open_automatic = false, -- Open if the buffer is compatible
autojump = true,
link_folds_to_tree = false,
link_tree_to_folds = false,
attach_mode = "global",
backends = { "lsp", "treesitter", "markdown", "man" },
disable_max_lines = vim.g.big_file.lines,
disable_max_size = vim.g.big_file.size,
layout = {
min_width = 28,
default_direction = "right",
placement = "edge",
},
show_guides = true,
guides = {
mid_item = "├ ",
last_item = "└ ",
nested_top = "│ ",
whitespace = " ",
},
keymaps = {
["[y"] = "actions.prev",
["]y"] = "actions.next",
["[Y"] = "actions.prev_up",
["]Y"] = "actions.next_up",
["{"] = false,
["}"] = false,
["[["] = false,
["]]"] = false,
},
},
config = function(_, opts)
require("aerial").setup(opts)
-- HACK: The first time you opened aerial on a session, close all folds.
vim.api.nvim_create_autocmd("FileType", {
desc = "Aerial: The first time its open on a session, close all folds.",
callback = function()
local is_aerial = vim.bo.filetype == "aerial"
local is_ufo_available = require("base.utils").is_available("nvim-ufo")
if is_ufo_available and is_aerial and vim.g.new_aerial_session == nil then
vim.g.new_aerial_session = false
require("aerial").tree_set_collapse_level(0, 0)
end
end,
})
end
},
@Zeioth I believe I've fixed the issue with multiple aerial windows opening when attach_mode = "global"
. I think this was the last bug in this scenario, so I'm closing this PR (it seems unlikely that we would want to revert this change anyway). If there are still problems, feel free to continue the discussion on the linked issue or create a new issue
Reverts https://github.com/stevearc/aerial.nvim/commit/51a07949abf169b4cad30e14c165ac1ec0ce4e6f
Closes: #369