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

bug: :AerialToggle does nothing while the cursor in inside :Neotree #352

Closed
Zeioth opened this issue Mar 12, 2024 · 1 comment
Closed

bug: :AerialToggle does nothing while the cursor in inside :Neotree #352

Zeioth opened this issue Mar 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Zeioth
Copy link

Zeioth commented Mar 12, 2024

Neovim version (nvim -v)

NVIM v0.9.5 release

Operating system/version

arch linux

Output of :AerialInfo

Aerial Info
-----------
Filetype: neo-tree
Aerial ignores this window: Buftype 'nofile' is "special". See the 'ignore' config in :help aerial-options
Configured backends:
  lsp (not supported) [No LSP client found that supports symbols]
  treesitter (not supported) [No treesitter parser for neo-tree]
  markdown (not supported) [Filetype is not markdown]
  man (not supported) [Filetype is not man]
Show symbols: Constructor, Enum, Function, Interface, Method, Struct

Describe the bug

:AerialToggle does nothing while the cursor in inside :Neotree.

Using :AerialToggle inside a buffer or aerial seems to work fine

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. :Nerdtree toggle
  2. :AerialToggle

It will fail to open.

Expected Behavior

Aerial should at least open.

Minimal example file

No response

Minimal init.lua

No response

Additional context

I've tried

wintypes = false,
buftypes = false,

And the issue remains. Also this is my config:

  --  [symbols tree]
  --  https://github.com/stevearc/aerial.nvim
  {
    "stevearc/aerial.nvim",
    event = "VeryLazy",
    cmd = {
      "AerialToggle",
      "AerialOpen",
      "AerialNavOpen",
      "AerialInfo",
      "AerialClose",
    },
    opts = {
      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,
      wintypes = false,
      buftypes = 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 },
      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 open 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 Zeioth added the bug Something isn't working label Mar 12, 2024
@stevearc
Copy link
Owner

Historically aerial wouldn't open for unsupported buffers/windows. At some point I changed the behavior to open even if there wasn't a supported backend, and added some better empty symbols messaging. Even after that change, we were still not opening aerial in "ignored" buffers (e.g. buftype=nofile), which is what you are experiencing. I don't like that we just drop the command without providing any user feedback, so I'll remove that constraint as well. I think opening an empty aerial window for an unsupported buffer is better than nothing happening and no feedback.

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