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: Trouble does not return focus to floating windows. #335

Open
3 tasks done
Austin-Ray opened this issue Sep 24, 2023 · 0 comments
Open
3 tasks done

bug: Trouble does not return focus to floating windows. #335

Austin-Ray opened this issue Sep 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@Austin-Ray
Copy link

Did you check docs and existing issues?

  • I have read all the trouble.nvim docs
  • I have searched the existing issues of trouble.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.10.0-dev-1183+gc68c121f5-dirty (happens on nvim 0.8 and 0.9 too)

Operating system/version

Gentoo Linux

Describe the bug

If the user's focus is on a floating window when invoking :Trouble then :TroubleClose or using auto_open then the cursor will be placed in a non-floating window, not the original floating location.

Steps To Reproduce

Generic:

  1. Open file.
  2. Open a floating window.
  3. Open Trouble with either :Trouble or auto_open.
  4. Cursor is in the file buffer.

Using the below repro:

  1. nvim -u repro.lua
  2. :Lazy update
  3. :Trouble
  4. :TroubleClose
  5. Cursor is in the file buffer when it should be in the Lazy pop-up

Expected Behavior

Cursor will be placed back in the floating window in the correct position.

Repro

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not 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/trouble.nvim",
    dependencies = { "nvim-tree/nvim-web-devicons" },
    config = true,
  },
}, {})
@Austin-Ray Austin-Ray added the bug Something isn't working label Sep 24, 2023
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

1 participant