Oh, anyway as a user I will follow your advice, but that should probably be
somewhere in the docs. Thanks for the advice :)

   David

On Feb 16, 2008 9:46 PM, David Rodríguez Ibeas <[EMAIL PROTECTED]> wrote:

> Hi,
>
>    I have always understood winheight as the height of only the focused
> window, and winminheight as the hard limit on how small a window can be.
> When a user selects a number of files during startup time (lets say N) we
> have conflicting requests: we want N windows, we want them winheight lines
> high and we have a limited screen size.
>
>    My understanding is that if you do want all your windows to be 10 lines
> high and no more windows created if that cannot be fullfilled,
> winminheight=10 is the way to go.
>
>    The formula (as I patched it) resolves the problem considering N as a
> stronger requirement than winheight (N is command line, winheight was set in
> a config file at any other time), but always complying with winminheight
> limit. Only as many windows of size winminheight are created
>
>    In a 50 lines screen, with winminheight set to 10, winheight set to 20
> and command line: vim -o file1 file2 file3 file4 file5, all 5 files can be
> opened in windows that are at least winminheight, even if they are not
> winheight high (ignoring status line sizes for clarity).
>
>    The question is which of the two conflicting request (number of windows
> / winheight) has to take precedence. For me, as user, I prefer the number of
> files, since that is a command line option while winheight is a config file
> option and to me with less precedence than winminheight. (This can be tested
> by trying to set winheight to a value that does not leave at least
> winminheight to any other window, change is rejected and only as much space
> as is available is yielded to the current window)
>
>    David
>
>
> On Feb 16, 2008 1:54 PM, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
>
> >
> > David Rodriguez Ibeas wrote:
> >
> > > During startup with .vimrc containing 'set winminheight=0
> > > winheight=999' no more than 2 windows are created, independently of
> > > number of files to open.
> > >
> > > $ vim -o file1 file2 file3 file4
> > >
> > > will open only two horizontally splitted windows. If winheight is
> > > removed from .vimrc file four horizontally splitted windows are
> > > created.
> > >
> > > The expected behavior with those config options are 4 horizontally
> > > splitted windows, one taking all available window space but the status
> > > lines. Config option recommendation were taken from windows.txt help
> > > file.
> > >
> > > Proposed patch (generated with svn diff window.c) modifies
> > > make_windows function in window.c, which does not seem to be used
> > > anywhere else:
> > >
> > > Index: window.c
> > > ===================================================================
> > > --- window.c    (revision 893)
> > > +++ window.c    (working copy)
> > > @@ -1264,15 +1264,15 @@
> > >      {
> > >         /* Each windows needs at least 'winminwidth' lines and a
> > > separator
> > >          * column. */
> > > -       maxcount = (curwin->w_width + curwin->w_vsep_width
> > > -                                            - (p_wiw - p_wmw)) /
> > > (p_wmw + 1);
> > > +               maxcount = (curwin->w_width + curwin->w_vsep_width)
> > > +                       / (p_wmw + 1);
> > >      }
> > >      else
> > >  #endif
> > >      {
> > >         /* Each window needs at least 'winminheight' lines and a
> > > status line. */
> > > -       maxcount = (curwin->w_height + curwin->w_status_height
> > > -                                 - (p_wh - p_wmh)) / (p_wmh +
> > > STATUS_HEIGHT);
> > > +               maxcount = (curwin->w_height + curwin-
> > > >w_status_height)
> > > +                       / (p_wmh + STATUS_HEIGHT);
> > >      }
> > >
> > >      if (maxcount < 2)
> >
> >
> > This breaks it for people who set 'winheight' to 10 and expect all
> > windows to be 10 lines high.
> >
> > Another solution is to set 'winheight' after startup is done:
> >
> >        au VimEnter * set winheight=999
> >
> >
> > --
> > How To Keep A Healthy Level Of Insanity:
> > 12. Sing along at the opera.
> >
> >  /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui