snacks.nvim
snacks.nvim copied to clipboard
bug(terminal): Focus Shift to Incorrect Split After Toggling Terminal
Did you check docs and existing issues?
- [x] I have read all the snacks.nvim docs
- [x] I have updated the plugin to the latest version before submitting this issue
- [x] I have searched the existing issues of snacks.nvim
- [x] I have searched the existing issues of plugins related to this issue
Neovim version (nvim -v)
0.10.3
Operating system/version
Fedora Linux
Describe the bug
If I have multiple vsplits open and toggle the terminal on and then off, always the left most window is selected afterwards. It should however jump back to the previously open one.
Steps To Reproduce
-
nvim -u repro.lua
- Open split
<C-w>v
- Jump to right window
<C-w>l
- Open terminal
:lua Snacks.terminal()
- Close terminal
:lua Snacks.terminal()
- Cursor now again in left window
Expected Behavior
After close the cursor goes to the position it was before opening the terminal, notably also the same window.
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 = {} },
},
})