lazygit.nvim icon indicating copy to clipboard operation
lazygit.nvim copied to clipboard

feat: resize window on nvim resize

Open chenasraf opened this issue 1 year ago • 4 comments

Fixes #116

https://github.com/kdheepak/lazygit.nvim/assets/167217/729c203a-c873-45c8-8346-cd7266d9eb2f

The defer is a bit of a hack, but otherwise the new size doesn't get enough time to be properly registered. It still sometimes messes up and positions itself slightly off sometimes if I try to do it several times fast, so maybe the delay needs to be adjusted, some debounce added, or we might want to find a different method for ensuring the window has the correct size.

chenasraf avatar Feb 13 '24 01:02 chenasraf

Thank you for the PR! This is something I've been meaning to look into for a while but haven't had the time to get to it.

kdheepak avatar Feb 13 '24 02:02 kdheepak

Hey, I was just facing this issue and just saw they are already a fix for it, thanks @chenasraf. Is there anything blocking that I can help with to get this into the mainline? Happy to learn some of the nvim API

savrielynck avatar May 08 '24 13:05 savrielynck

Hey, I was just facing this issue and just saw they are already a fix for it, thanks @chenasraf. Is there anything blocking that I can help with to get this into the mainline? Happy to learn some of the nvim API

It's pretty much working, the problem is it's kind of wonky and isn't very consistent. You can see the discussion here - something about the resizing logic between the 2 systems is not aligning right.

Honestly I have no idea why this happens, if you want to give it a go, please be my guest :)

I am currently using my own fork which is exactly only this PR added, so I am using it daily myself, but I'm not sure it's good enough quality to have for everyone yet.

chenasraf avatar May 08 '24 13:05 chenasraf