folke / edgy.nvim

Easily create and manage predefined window layouts, bringing a new edge to your workflow
Apache License 2.0
861 stars 17 forks source link

Bug: Using Edgy with Aerial and Neotree causes automatic window shrinking #113

Open Oneechan69 opened 1 month ago

Oneechan69 commented 1 month ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.10.1 Build type: Release LuaJIT 2.1.1725453128

Operating system/version

macOS 15.1 Beta

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:

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

Repro

-- 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,
    })
github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 weeks ago

This issue was closed because it has been stalled for 7 days with no activity.