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: Explorer behaviour with window movement commands not as expected #1520

Open
4 tasks done
caenrique opened this issue Mar 7, 2025 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working

Comments

@caenrique
Copy link

Did you check docs and existing issues?

  • I have read all the snacks.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of snacks.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

v0.11.0-dev-1804+g2e0a563828

Operating system/version

MacOS 15.3

Describe the bug

Window commands doesn't behave as expected. Instead of moving the focus to the window immediately to the right of the explorer, when multiple windows are open, it jumps to the previous window instead.

Steps To Reproduce

Setup:

  • Vertical split with two windows: A | B
  • The cursor is on the right one (B)
  • Open the explorer
  • hit <C-w>l

Expected Behavior

Expectation: Move the focus to the window immediately to the right of the explorer (A)
Behaviour: The focus goes to the previous window instead (B)

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/snacks.nvim", opts = {} },
    -- add any other plugins here
  },
})
@caenrique caenrique added the bug Something isn't working label Mar 7, 2025
@dpetka2001
Copy link
Contributor

That happens because the Explorer window is actually a floating window.

The same happens with vanilla Neovim. Just do nvim --clean and then :vsplit and put your cursor on the right window. Then create a floating window with lua vim.api.nvim_open_win(vim.api.nvim_create_buf(false,true), true, {relative = "editor",width = 50, height = 20, row = 10, col = 10, style = "minimal"}) and then press <C-w>l and see where the cursor will land. It will land on the window where your cursor previously was.

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