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: Using Aerial with Edgy causes automatic window shrinking #415

Open
Oneechan69 opened this issue Sep 28, 2024 · 0 comments
Open

Bug: Using Aerial with Edgy causes automatic window shrinking #415

Oneechan69 opened this issue Sep 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Oneechan69
Copy link

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 Oneechan69 added the bug Something isn't working label Sep 28, 2024
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

1 participant