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: Floating window is closed when jump even with close_on_select = false #336

Open
amano-takahisa opened this issue Dec 20, 2023 · 2 comments
Labels
bug Something isn't working P2 Not a priority. PRs welcome

Comments

@amano-takahisa
Copy link

Neovim version (nvim -v)

NVIM v0.9.4

Operating system/version

Arch Linux

Output of :AerialInfo

Aerial Info

Filetype: python
Configured backends:
treesitter (supported) (attached)
lsp (supported)
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

With config close_on_select = false, floating window is closed when I click an item in the window to jump.

Previously, the floating window remained even I jumped, so the window was conveniently used as an index by displaying it in the upper right corner of the editing window.
At some point, (may be from this commit?) the window disappeared when I clicked to jump.

Since the floating window is very useful when I editing multiple files with split windows, it would be great if you could provide an option which I can keep the floating window.

What is the severity of this bug?

minor (annoyance)

Steps To Reproduce

  1. Add config close_on_select = false. (I think it's default.)
  2. Open floating window with :AerialOpen float.
  3. Click an item in the floating window.

Expected Behavior

The floating window is kept open even editing window is jumped to the code.

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

@amano-takahisa amano-takahisa added the bug Something isn't working label Dec 20, 2023
@stevearc
Copy link
Owner

Yeah, that commit is probably where this changed. The trouble is there are some people that expect the floating window to auto-close, and some people that want it to remain open. You could create a keymap that re-opens the float after navigation, would this work for you?

local aerial = require("aerial")
aerial.setup({
  keymaps = {
    ["<CR>"] = function()
      aerial.select()
      aerial.open({ direction = "float" })
    end
  }
})

@stevearc stevearc added the P2 Not a priority. PRs welcome label Dec 24, 2023
@amano-takahisa
Copy link
Author

Thank you for your suggestion. The suggested keymap setup works as you described in my environment.
However, I want to keep floating window all the time.
The keymap config close the floating window when another window is selected with mouse click, c-w v etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Not a priority. PRs welcome
Projects
None yet
Development

No branches or pull requests

2 participants