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

Always equal resize when toggle (horizontal) split windows

Open hunter-street opened this issue 10 years ago • 3 comments

I have (horizontal) split windows and manually set the sizes. But when I switch focus between windows VIM always equally resize them.

hunter-street avatar Feb 11 '15 10:02 hunter-street

I am not a VIM plugin writter but I found below change will fix it somehow...

diff --git a/plugin/minibufexpl.vim b/plugin/minibufexpl.vim index 8ef2aa8..74d33e5 100644 --- a/plugin/minibufexpl.vim +++ b/plugin/minibufexpl.vim @@ -1190,7 +1190,7 @@ function! <SID>ResizeWindow()

 let saved_ead = &ead
 let &ead = 'ver'
  • set equalalways
  • set noequalalways let &ead = saved_ead set noequalalways

hunter-street avatar Feb 11 '15 10:02 hunter-street

man I spent hours trying to figure this out :( It was this plugin that was causing the issue, so annoying. It would be nice if the author just fixes this because it is harder to to use a custom patch because using a vim plugin manager means it will be overwritten at some piunt

gerroon avatar Mar 23 '15 21:03 gerroon

Just fell victim to this as well on Fedora 21 / vim 7.4. In case someone needs to reproduce:

  • start a "clean" vim $ vim -N -u /dev/null -i /dev/null --noplugin
  • load minibufexplorer :source ~/.vim/plugin/minibufexpl.vim
  • split window :split
  • resize the split so the two windows have different sizes :10wincmd +
  • toggle minibufexplorer and observe the bug :MBEToggle

The patch from hunter-street helps but my window layout still breaks with multiple splits. I have commented both blocks in ResizeWindow():

"    let saved_ead = &ead
"    let &ead = 'ver'
"    set equalalways
"    let &ead = saved_ead
"    set noequalalways
"    let saved_ead = &ead
"    let &ead = 'hor'
"    set equalalways
"    let &ead = saved_ead
"    set noequalalways

And now with several calls to MBEToggle all my horizontal splits end up 'minimized' at the top of the screen, below the minibufexplorer window.

Marek77 avatar May 22 '15 09:05 Marek77