Closed jflorian closed 5 years ago
Try the "VimResized" autocmd, like
autocmd VimResized * wincmd =
in your vimrc.
That's the proper solution, because there's no way for us to resize any earlier.
(via https://vi.stackexchange.com/questions/201/make-panes-resize-when-host-window-is-resized)
Beautiful! That works like a charm. Thanks so much for the super fast response.
I'm seeing an issue that looks to be a race condition and am trying to figure out a kludge of sorts to resolve it. When gvimdiff creates a new window, it attempts to give each buffer an equal portion of the overall window. This division seems to usually occur before kwin-tiling sets the size so the buffer proportions are derived from a maximal-sized window then kwin-tiling does its sizing, likely making the gvimdiff window smaller to tile it and thus the buffer proportions are all off. In some rare cases kwin-tiling gets there first and then buffer proportions are equal.
If they're unequal, I can give vim a
^w=
command to correct them but am hoping for a solution where this is unnecessary. I've tried the following in my vimrc but this doesn't help because it executes before the window is drawn:The
sleep
andredraw
are attempts to crudely rig the race but these actually cause the contents to be drawn on the konsole window from which I'm launching gvim and this still happens before the window appears. In essence, thesleep
only further delays the window creation.