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

bug: <leader> Key Stops Working After Opening Aerial Window

Open devxpain opened this issue 1 year ago • 1 comments

Neovim version (nvim -v)

NVIM v0.10.2

Operating system/version

MacOS 15.1.1

Output of :AerialInfo

Aerial Info

Filetype: rust Configured backends: treesitter (supported) (attached) lsp (supported) markdown (not supported) [Filetype is not markdown] 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

After opening the Aerial window, my <leader> key sometimes stops working. However, if I press other keys like ':' or '?', it seems to reset, and then my <leader> key starts working again. My <leader> key is set to the space key.

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. Clone the repository: https://github.com/barter-rs/barter-rs
  2. Open Neovim in the barter-rs directory.
  3. Open the Aerial window using :AerialOpen.
  4. Navigate around the barter-rs source code.
  5. Each time you open a file, test the <leader> key to check if it works. You will notice that at some point the <leader> key stops working. It will remain non-functional until you press keys like : or ?, which seem to reset something.

Expected Behavior

The <leader> key should function consistently.

Minimal example file

No response

Minimal init.lua

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "--single-branch",
    "https://github.com/folke/lazy.nvim.git",
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  {
    "stevearc/aerial.nvim",
    config = function()
      require("aerial").setup({
        -- add your aerial config here
      })
    end,
  },
  {
    "nvim-treesitter/nvim-treesitter",
    build = ":TSUpdate",
    config = function()
      require("nvim-treesitter.configs").setup({
        ensure_installed = { "c", "lua" },
        auto_install = true,
        highlight = { enable = true },
      })
    end,
  },
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here

Additional context

No response

devxpain avatar Dec 17 '24 00:12 devxpain

Unable to repro. I'm using the minimal init file

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

vim.g.mapleader = " "

vim.keymap.set("n", "<leader><leader>", "<cmd>echomsg 'leader is working'<CR>")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
	vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
	vim.fn.system({
		"git",
		"clone",
		"--filter=blob:none",
		"--single-branch",
		"https://github.com/folke/lazy.nvim.git",
		lazypath,
	})
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
	"folke/tokyonight.nvim",
	{
		"stevearc/aerial.nvim",
		config = function()
			vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle<CR>")
			require("aerial").setup({
				-- add your aerial config here
			})
		end,
	},
	{
		"nvim-treesitter/nvim-treesitter",
		build = ":TSUpdate",
		config = function()
			require("nvim-treesitter.configs").setup({
				ensure_installed = { "c", "lua", "rust" },
				auto_install = true,
				highlight = { enable = true },
			})
		end,
	},
	-- add any other plugins here
}
require("lazy").setup(plugins, {
	root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")

I opened files in the repo, toggled aerial open, and confirmed that at all points <space><space> prints the message "leader is working". Can you produce a more specific set of repro steps using this minimal config?

stevearc avatar Dec 21 '24 13:12 stevearc