zbirenbaum / nvterm

NvChad's Official Terminal Plugin ( Unmaintained but still usable and stable), wait for v3.0
GNU General Public License v3.0
181 stars 20 forks source link

Split ratio changing while using it #22

Closed cvignal closed 1 year ago

cvignal commented 2 years ago

Hello, I've been trying to use nvterm but I'm not a fan of the default split ration for vertical terminal and tried to change it to 0.3. It does work when opening the terminal but the ratio changes back to 0.5 (the default) when certain events occur such as opening NvimTree. Here is a recording to show what I mean. video-nvterm.webm

Thanks in advance for your help

theowenyoung commented 2 years ago

Yes, I can reproduce this error. just setting up a fresh NvChad, here is the path to reproduce:

nvim
:edit test.txt
<C-n>
<C-l>
<M-h>
<C-x><C-w>k

then the horizontal terminal window will expand to 0.5 ratios, it's really annoying.

theowenyoung commented 2 years ago

It seems this setting cause this error:

https://github.com/NvChad/NvChad/blob/27560319cc4cf753e5a4d8713f82206d84a70d61/lua/plugins/configs/nvimtree.lua#L26

when it was false, everything is fine.

zbirenbaum commented 2 years ago

If this is an nvim-tree issue, is it safe to close this? I'm a bit lost on whether there's anything actionable inside of nvterm based on the linked issues.

siduck commented 2 years ago

If this is an nvim-tree issue, is it safe to close this? I'm a bit lost on whether there's anything actionable inside of nvterm based on the linked issues.

it seems like the split-ratio gets changed when toggling nvimtree, so @cvignal most probably wants to have a fixed split-ratio

siduck commented 2 years ago

@cvignal but this behaviour happens with normal buffers too, try this

Open a file in vertical split and resize it , then toggle nvimtree. The same thing happens!

So this is most probably a nvimtree issue

theowenyoung commented 2 years ago

yes, it is most probably a nvimtree issue, even adaptive_size=false, the split-ratio gets changed when toggling nvimtree.

husnaram commented 2 years ago

same here. when nvimtree close, and trying to move to editor and terminal, the issue does not occur.

siduck commented 2 years ago

same here. when nvimtree close, and trying to move to editor and terminal, the issue does not occur.

its a nvimtree issue

VioletXF commented 1 year ago

It's not a bug, it's a feature. Simply add this option to nvim-tree

view = {
...
  preserve_window_proportions = true,
}

BTW I think this should be default option.

siduck commented 1 year ago

@VioletXF ik im late, done!