Bram Moolenaar wrote:
> Tony Mechelynck wrote:
> 
>> Bram Moolenaar wrote:
>>> Patch 7.1.068
>>> Problem:    When 'equalalways' is set and splitting a window, it's possible
>>>         that another small window gets bigger.
>>> Solution:   Only equalize window sizes when after a split the windows are
>>>         smaller than another window. (Martin Toft)
>>> Files:          runtime/doc/options.txt, runtime/doc/windows.txt, 
>>> src/window.c
>> [...]
>>
>> I guess there's something I don't understand.
>>
>> Let's say 'equalalways' is set and I've used Ctrl-W _ to temporarily make 
>> the 
>> current window full-size, squashing all windows above and below it to 
>> 'winminheight' (which I have set to zero in my vimrc).
>>
>> If I create or delete a window (e.g. with ":split") I would expect 
>> 'equalalways' to come into play, and redraw all windows to the same size 
>> (growing small windows and shrinking the current big one and its new child).
>>
>> This is in accord with how I understand the current (2007 Jul 11) help for 
>> 'equalalways'.
>>
>> What is wrong in my way of thinking?
> 
> If you make the current window use the maximum available space, and then
> do ":split", don't you expect the two windows, the current one and the
> new one, to occupy the same space?  That is what I expect.

no, if I use ^W_ with 'equalalways' set, it is temporary. If after that I use 
":split", ":new", ":sview", ":q", ":x", or anything that changes the number of 
windows, then poof! they are all equal again. That's how Vim has always 
behaved, and I thought it was the normal behaviour. If I wanted my windows to 
stay unequal for any length of time, I would set 'noequalalways'.

> 
> The 'equalalways' option has the intention to spread out the available
> space, so that when you ":split" you can use the space from other
> windows.  But when the space from the current window is sufficient that
> is not needed.  That is what this patch fixes.

The way I understood the help (and, until now, experiment bore me out) was 
that 'equalalways' was meant to make all windows "always equal", except that 
you could temporarily change window sizes. But such changes would not persist 
over a window-creation or -deletion, as long as 'equalalways' was on.

> 
> Another situation: I often have a window open to a file where I add
> remarks.  This only needs to be a few lines tall.  When I split the main
> window this other window is suddenly made a lot bigger, and I have to
> resize it again.  After this patch it works as I would expect.

If you want one window to be (and remain) a different size than all others, 
then leave 'equalalways' off. Or maybe use ":setlocal winfixheight".

This patch breaks age-old documented behaviour -- documented under 
'equalalways' and maybe elsewhere: here is the 'equalalways' text:

        When on, all the windows are automatically made the same size after
        splitting or closing a window.  This also happens the moment the
        option is switched on.  When off, [...]


> 
> Obviously it still isn't perfect, when closing a window the
> intentionally small window still gets bigger.  Vim can't know you don't
> want this window to get some of the newly available space.  A more
> advanced solution could perhaps resize proportionally.  But it's
> probably very difficult to make that work well, considering windows can
> be split horizontally and vertically to make very complex window
> layouts.
> 


Best regards,
Tony.
-- 
All wars are civil wars, because all men are brothers ... Each one owes
infinitely more to the human race than to the particular country in
which he was born.
                -- Francois Fenelon

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui