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: deleting the sidebar buffer breaks sidebar shortcuts until neovim restart #398

Closed
emmanueltouzery opened this issue Jan 22, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@emmanueltouzery
Copy link
Contributor

Neovim version (nvim -v)

NVIM v0.10.2 Build type: Release LuaJIT 2.1.1713484068

Operating system/version

linux fedora 41

Describe the bug

if the overseer sidebar buffer is closed, OverseerToggle reopens it, but actions on enter and other shortcuts don't work anymore.

What is the severity of this bug?

tolerable (can work around it)

Steps To Reproduce

  1. nvim -u repro.lua
  2. :OverseerRunCmd
  3. cmd: sleep 100
  4. OverseerToggle
  5. :bd
  6. OverseerToggle
  7. enter and other shortcuts don't work anymore

Expected Behavior

OverseerToggle should reset all the state needed for the sidebar to operate, even if the overseer buffer was deleted by the user by mistake

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/dressing.nvim", config = true },
  {
    "stevearc/overseer.nvim",
    config = function()
      require("overseer").setup({
        -- add your overseer config here
      })
    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

@emmanueltouzery emmanueltouzery added the bug Something isn't working label Jan 22, 2025
@emmanueltouzery emmanueltouzery changed the title bug: bug: deleting the sidebar buffer breaks sidebar shortcuts until neovim restart Jan 22, 2025
@stevearc
Copy link
Owner

Something was reloading the buffer after unload, which was preventing us from fully garbage collecting the state. I added a better way to enforce cleanup.

emmanueltouzery added a commit to emmanueltouzery/nvim_config that referenced this issue Jan 24, 2025
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