aerial.nvim icon indicating copy to clipboard operation
aerial.nvim copied to clipboard

Bug: Using Aerial with Edgy causes automatic window shrinking

Open Oneechan69 opened this issue 4 months ago • 0 comments

Neovim version (nvim -v)

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1725453128

Operating system/version

macOS 15.1 Beta

Output of :AerialInfo

Aerial Info

Filetype: markdown Configured backends: treesitter (supported) (attached) lsp (supported) 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

6Lo9xDBM

When I open Nvim, Aerial is focused and when I focus on the file, the height reduces. I looked through the documentations of those three plugins but can't figure out what is going on. The issue doesn't occur when do any of the following:

  • I take out any of those three plugins: when Neotree and Aerial open without Edgy, and when Edgy just opens either Neotree or Aerial.
  • When I replace vim.cmd("Neotree buffers") with vim.cmd("copen")
  • When I just take out attach_mode = "global" from Aerial config (refer to config below), but I want to keep it. The setting makes it render an outline for the currently focused file.

What is the severity of this bug?

tolerable (can work around it)

Steps To Reproduce

  1. Save the config as repro.lua
  2. Run it with nvim -u repro.lua "blank.md"

Expected Behavior

The window doesn't resize automatically

Minimal example file

(a blank .md file)

Minimal init.lua

-- LazyNvim Setup
    local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
    if not (vim.uv or vim.loop).fs_stat(lazypath) then
      vim.fn.system({
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable", -- latest stable release
        lazypath,
      })
    end
    vim.opt.rtp:prepend(lazypath)
    require("lazy").setup({
        {
          "folke/edgy.nvim",
          event = "VeryLazy",
          opts = {
            left = {
              -- Neo-tree filesystem always takes half the screen height
              {
                title = "Neo-Tree",
                ft = "neo-tree",
              },
              { ft = "qf", title = "QuickFix" },
              {
                title = "Aerial",
                ft = "aerial",
              },
            },
            bottom = {
              size = 1,
              {
                ft = "help",
                size = { height = 20 },
                -- only show help buffers
                filter = function(buf)
                  return vim.bo[buf].buftype == "help"
                end,
              },
            }
          }
        },
        {
            "nvim-neo-tree/neo-tree.nvim",
            branch = "v3.x",
            lazy = false,
            dependencies = {
              "nvim-lua/plenary.nvim",
              "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
              "MunifTanjim/nui.nvim",
              -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
            },
            opts = {
              sources = { "filesystem", "buffers", "git_status", "document_symbols" },
              open_files_do_not_replace_types = { "terminal", "Trouble", "trouble", "qf", "Outline" },
              filesystem = {
                follow_current_file = { enabled = true },
                use_libuv_file_watcher = true,
              },
              window = {
                mappings = {
                  ["<space>"] = "none",
                  ["Y"] = {
                    function(state)
                      local node = state.tree:get_node()
                      local path = node:get_id()
                      vim.fn.setreg("+", path, "c")
                    end,
                    desc = "Copy Path to Clipboard",
                  },
                  ["O"] = {
                    function(state)
                      require("lazy.util").open(state.tree:get_node().path, { system = true })
                    end,
                    desc = "Open with System Application",
                  },
                },
              },
              default_component_configs = {
                indent = {
                  with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
                  expander_collapsed = "",
                  expander_expanded = "",
                  expander_highlight = "NeoTreeExpander",
                },
                git_status = {
                  symbols = {
                    unstaged = "󰄱",
                    staged = "󰱒",
                  },
                },
              },
            }
          },
          {
            'stevearc/aerial.nvim',
            opts = {},
            -- Optional dependencies
            dependencies = {
               "nvim-treesitter/nvim-treesitter",
               "nvim-tree/nvim-web-devicons"
            },
            config = function()
              require("aerial").setup({
                attach_mode = "global",
              })
            end,
          },
    })
    
    -- Auto-open Neotree when opening a markdown file
    vim.api.nvim_create_autocmd("BufRead", {
        pattern = "*.md",
        callback = function()
          vim.cmd("Neotree buffers")
          vim.cmd("AerialOpen")
        end,
    })

Additional context

No response

Oneechan69 avatar Sep 28 '24 23:09 Oneechan69