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
977 stars 43 forks source link

Regression of #16? The resize direction is unexpectedly reversed, with neo-tree open in vertical split #24

Closed krishnakumarg1984 closed 2 years ago

krishnakumarg1984 commented 2 years ago

Looks like a regression of #16, GitHub didn't allow me to reopen that issue, so I shall repeat the issue here again for the sake of completeness.

When a tree explorer window such as neo-tree is open to the left in a vertical split to the current buffer, smart-splits does not work as expected. In fact, it has the opposite behavior. When resizing the main buffer with "Ctrl+left", it resizes to the right, making the current buffer smaller and filetree buffer larger. Similarly, the opposite behavior is noted with "<Ctrl + right>".

mrjones2014 commented 2 years ago

Can you try each commit and help figure out which commit introduced the regression?

ttytm commented 2 years ago

It's hard to hunt this down, I've checked the commits and what I can tell is that this has probably not to do with the commits or even the plugin at all.

It is only reproducible having winfixwidth set. And then this bug also happens using a simpler Smart resizing function instead of the plugin like this one:

vim.cmd [[
fun! SmartResize()
    if winnr() == winnr('$')
        nnoremap <silent> <C-Right> :vertical resize -2<CR>
        nnoremap <silent> <C-Left> :vertical resize +2<CR>
    else
        nnoremap <silent> <C-Right> :vertical resize +2<CR>
        nnoremap <silent> <C-Left> :vertical resize -2<CR>
    endif
endfun
]]
mrjones2014 commented 2 years ago

I don't think there's really anything we can do about this situation then, other than just say it doesn't work if you use winfixwidth