lens.vim icon indicating copy to clipboard operation
lens.vim copied to clipboard

lens.vim stretches windows opened via FZF

Open gregorias opened this issue 4 years ago • 1 comments

When you open a new vertically split window through FZF, lens.vim stretches that window to maximal allowed width.

I've created a minimal example at https://github.com/gregorias/lens.vim-fzf-issue that reproduces this issue. I've also recorded an example.

The expected behavior would be for lens.vim to open the new window in an equal vertical split (or just not resize the window).

The reason why this happens is that two WinEnter events happen when FZF does a split. During the first enter (i.e., FZF just returns to the original window), the target window is at full width and lens.vim starts animating. Then FZF opens a new window, and, when the second WinEnter happens, the target window has the proper width (equally split across both windows) but the started animation prevents lens.vim from adjusting (there's an explicit if: https://github.com/camspiers/lens.vim/blob/master/plugin/lens.vim#L132).

gregorias avatar Jan 15 '21 15:01 gregorias

I also see this behaviour when opening files with floaterm's ranger wrapper.

echarliewhite avatar Oct 06 '21 15:10 echarliewhite

Marking as abandoned.

gregorias avatar Aug 14 '22 19:08 gregorias