smart-splits.nvim
smart-splits.nvim copied to clipboard
[Bug]: In vertical split, if accidentally smartsplits.resize_up, the layout becomes stuck in shorter height
Similar Issues
- [x] Before filing, I have searched for similar issues.
Neovim Version
nvim v0.11.1
Multiplexer Integration
tmux
Multiplexer Version
Using Ghostty terminal. There are no conflicting binding. When I remove the resize_up binding, the problem goes away.
Ghostty 1.1.2-r285.gee8ae19-1-arch
Version
- version: 1.1.2-r285.gee8ae19-1-arch
- channel: tip Build Config
- Zig version: 0.13.0
- build mode : builtin.OptimizeMode.ReleaseFast
- app runtime: apprt.Runtime.gtk
- font engine: font.main.Backend.fontconfig_freetype
- renderer : renderer.OpenGL
- libxev : io_uring
- desktop env: other
- GTK version: build : 4.16.12 runtime : 4.18.5
- libadwaita : enabled build : 1.6.4 runtime : 1.7.2
- libX11 : enabled
- libwayland : enabled
Steps to Reproduce
Step to reproduce:
- Split vertical
- smartsplits.resize_up
Expected Behavior
Don't resize up when there are no horizintal split or resize down on resize_down
Actual Behavior
Stuck in resized up
Minimal Configuration to Reproduce
Here's my config:
return {
{
"mrjones2014/smart-splits.nvim",
lazy = false,
config = function()
require("smart-splits").setup({
default_amount = 7,
swap = {
-- this will create the mapping like
-- <leader><C-h>
-- <leader><C-j>
-- <leader><C-k>
-- <leader><C-l>
mod = '<C>',
prefix = '<leader>',
},
})
-- resizing splits
-- these keymaps will also accept a range,
-- for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
local smartsplits = require('smart-splits')
vim.keymap.set('n', '<M-S-Left>', smartsplits.resize_left, {desc = "Resize pane <-left"})
vim.keymap.set('n', '<M-S-Right>', smartsplits.resize_right, {desc = "Resize pane ->right"})
vim.keymap.set('n', '<M-S-Up>', smartsplits.resize_up, {desc = "Resize pane to up"})
vim.keymap.set('n', '<M-S-Down>', smartsplits.resize_down, {desc = "Resize pane down"})
-- moving between splits
vim.keymap.set('n', '<C-w><left>', smartsplits.move_cursor_left) -- These can more from left to right even when outbound
vim.keymap.set('n', '<C-w><down>', smartsplits.move_cursor_down)
vim.keymap.set('n', '<C-w><up>', smartsplits.move_cursor_up)
vim.keymap.set('n', '<C-w><right>', smartsplits.move_cursor_right)
vim.keymap.set('n', '<C-\\>', smartsplits.move_cursor_previous)
-- swapping buffers between windows
vim.keymap.set('n', '<leader><C-h>', require('smart-splits').swap_buf_left)
vim.keymap.set('n', '<leader><C-j>', require('smart-splits').swap_buf_down)
vim.keymap.set('n', '<leader><C-k>', require('smart-splits').swap_buf_up)
vim.keymap.set('n', '<leader><C-l>', require('smart-splits').swap_buf_right)
end
},
}
Additional Details and/or Screenshots
No response
Can't reproduce in Zellij, must be a tmux specific issue.
Is it your terminal or neovim that gets resized in this situation?
No, only nvim. I don't use tmux
Ah, well in the issue you wrote that you're using tmux.
Seems this is only reproducible when not using any multiplexer.
can you test if #373 fixes the issue