Wednesday, January 27, 2010

Re: :new with a count doesn't respect 'equalalways'

Brett Stahlman wrote:

> When :new is used *without* a count and 'equalalways' is set, the height
> of all existing windows is reduced to make room for the new one. (Well,
> technically, it's possible that the height of a small window will be
> increased, but the bottom-line is that, because of 'equalalways', all of
> the original windows will be the same height after the new window is
> created. Intuitively (and on the basis of the documentation), I would
> expect that when a count is supplied to :new (and 'equalalways' is set),
> the result would be the same, except that the newly created window might
> have a height that is different from all the others. In other words, the
> new window would be allocated its requested space, then the remaining
> height would be divided equally amongst the existing windows. This is
> not what happens, however. In fact, the presence of a count causes Vim
> to resize only the windows it has to. If N is such that the new window
> will fit within the old, the height of the other (non-current) windows
> is not changed at all; in fact, it works just as though 'equalalways'
> were not set. This seems to contradict the Vim help on :new
> (specifically, the parenthetical beginning with "and others, ...")...
>
> >>>
> Make new window N high (default is to use half the existing
> height). Reduces the current window height to create room (and
> others, if the 'equalalways' option is set and 'eadirection'
> isn't "hor").
> <<<
>
> Note that there is nothing to indicate that the "and others, ..."
> parenthetical applies only when the default argument is used. Am I
> misinterpreting the help, or is this a bug? Note that the same
> discrepancy seems to exist for the :split command.

If you have 'equalalways' set and specify a size of a window you have a
conflict. The way it's implemented the window is first split (each
split window getting half the available height), then 'equalalways' is
applied. If the same would be done when a size is specified then the
size will be overruled by 'equalalways'. Can't have both without some
special trickery.

--
hundred-and-one symptoms of being an internet addict:
153. You find yourself staring at your "inbox" waiting for new e-mail
to arrive.

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

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

No comments: