smart-splits.nvim icon indicating copy to clipboard operation
smart-splits.nvim copied to clipboard

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

Open krishnakumarg1984 opened this issue 3 years ago • 3 comments

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>".

krishnakumarg1984 avatar Jun 23 '22 18:06 krishnakumarg1984

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

mrjones2014 avatar Jun 28 '22 16:06 mrjones2014

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
]]

ttytm avatar Jul 14 '22 20:07 ttytm

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

mrjones2014 avatar Aug 11 '22 19:08 mrjones2014