Wednesday, January 27, 2010

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

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.

Thanks,
Brett Stahlman

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

No comments:

Post a Comment