folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.43k stars 177 forks source link

bug: If the window (win) position = "bottom" config value is set then when in a vertical split and running a command the cursor will switch back to the left window. #816

Closed madcdevelop closed 2 months ago

madcdevelop commented 3 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

10.0

Operating system/version

Windows 10

Describe the bug

The cursor switches sides of a vertical split after exiting the which-key popup with window position = "bottom" set. If this is not set then it works fine and the cursor stays in the window it was in.

LeftSideSplitIncorrectLocation

Steps To Reproduce

  1. set position = "bottom" in the config for win.
    win = {
    border = "single", -- none, single, double, shadow
    padding = { 2, 2 }, -- extra window padding [top, right, bottom, left]
    wo = {
      winblend = 0,
    },
    },
  2. Run Neovim
  3. Enter the command :vsplit
  4. Go to the right window
  5. Bring up which-key with
  6. Hit key
  7. The cursor goes to the other window.

Expected Behavior

The cursor should stay in the same window. If position = "bottom" is not set in the local config then it works as expected, the cursor stays in the same window.

Health

No response

Log

No response

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/which-key.nvim", opts = {} },
    -- add any other plugins here
  },
})
github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 2 months ago

This issue was closed because it has been stalled for 7 days with no activity.