mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
979 stars 43 forks source link

Incorrect resizing with more complicated layous #11

Closed mehalter closed 2 years ago

mehalter commented 2 years ago

Great work on this plugin! I am testing it out to fix my split resizing woes. I just wanted to report that for somewhat complicated split layouts the resizing bindings stop working as I would expect them to. This layout is an example:

2022-03-23_10:17:31_screenshot

This is 5 splits in the following order: vertical split, horizontal split on the right, and a horizontal split on the left to make a 2x2 grid. Then finally doing a vertical split on the top left box in the grid.

After that is created if I go to the split that is highlighted in the screenshot, resize right moves the left edge to the left and resize left moves the left edge to the right. It looks like this happens any time I have nested splits of different directions.

mrjones2014 commented 2 years ago

Okay I think I figured it out. It's due to the fact that if you move the cursor down, then back up, in this situation, you won't be in the original window. I've added some edge checking to account for that. Test it out and let me know if this is fixed, and everything else still works.