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: "Could not find destination window" when exiting help window #297

Closed
llllvvuu opened this issue Sep 25, 2023 · 1 comment
Closed

bug: "Could not find destination window" when exiting help window #297

llllvvuu opened this issue Sep 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@llllvvuu
Copy link

Neovim version (nvim -v)

NVIM v0.10.0-dev-1185+gc88bb658c

Operating system/version

MacOS 13.4.1

Output of :AerialInfo

Aerial Info                                                                                                                                                                                                                                                          
-----------                                                                                                                                                                                                                                                          
Filetype: help                                                                                                                                                                                                                                                       
Configured backends:                                                                                                                                                                                                                                                 
  treesitter (supported) (attached)                                                                                                                                                                                                                                  
  lsp (not supported) [No LSP client found that supports symbols]                                                                                                                                                                                                    
  markdown (not supported) [Filetype is not markdown]                                                                                                                                                                                                                
  man (not supported) [Filetype is not man]                                                                                                                                                                                                                          
Show symbols: Class, Constructor, Enum, Function, Interface, Module, Method, Struct 

Describe the bug

An error is printed: "Could not find destination window" when closing the help window.

Steps To Reproduce

  1. :h vim
  2. open aerial
  3. :helpclose or <C-w>c

(can also set open_automatic and it will apply to help window)

Expected Behavior

No error

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

@llllvvuu llllvvuu added the bug Something isn't working label Sep 25, 2023
@stevearc
Copy link
Owner

Some amount of this is to be expected. If you close the help window while your cursor is in the aerial window, no autocmds are dispatched so we have no way to know that the window was closed. If you then use <CR> or some other keybind to try to jump to the symbol, there will be an error.

I assume that you have autojump = true set in your config, though it is not present in the minimal config provided. The one thing that could be improved is we could silence the autojump errors when you move your cursor around an orphaned aerial window.

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