On Thu, Jul 17, 2014 at 6:32 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > --047d7bdc801adb733f04fe52c63e
> > Content-Type: text/plain; charset=UTF-8
> >
> > On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira <
> > yukihiro.nakada...@gmail.com> wrote:
> >
> > > On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira <
> > > yukihiro.nakada...@gmail.com> wrote:
> > >
> > >>
> > >> On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar <b...@moolenaar.net>
> > >> wrote:
> > >>
> > >>>
> > >>> Patch 7.4.372
> > >>> Problem:    When 'winminheight' is zero there might not be one line
> for
> > >>> the
> > >>>             current window.
> > >>> Solution:   Change the size computations. (Yukihiro Nakadaira)
> > >>> Files:      src/window.c
> > >>>
> > >>
> > >> I'm sorry, this patch have a bug.  Please revert for now.
> > >>
> > >> $ vim -u NONE -N
> > >> :set winminwidth=0 winminheight=0
> > >> :while 1 | split | endwhile
> > >> :topleft vsplit
> > >> :split
> > >> E36: Not enough room
> > >> Expected: split the window
> > >>
> > >
> > > I'm sorry, this behavior is not due to this patch.  This seems original
> > > behavior.  hmm...
> > >
> >
> > With or without this patch, split will fail when 'winminheight' is
> non-zero.
> >
> > $ vim -u NONE -N
> > :set winminheight=1
> > :while 1 | split | endwhile
> > :topleft vsplit
> > :split
> > E36: Not enough room
>
> I'll add it on the todo list.


I wrote patch for this problem.  Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff -r febc041c984b src/window.c
--- a/src/window.c      Wed Jul 16 23:39:54 2014 +0200
+++ b/src/window.c      Thu Jul 17 18:21:30 2014 +0900
@@ -684,7 +684,7 @@
     int                available;
     int                oldwin_height = 0;
     int                layout;
-    frame_T    *frp, *curfrp;
+    frame_T    *frp, *curfrp, *frp2, *prevfrp;
     int                before;
     int                minheight;
     int                wmh1;
@@ -730,12 +730,33 @@
        needed = wmw1 + 1;
        if (flags & WSP_ROOM)
            needed += p_wiw - wmw1;
-       if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+       if (flags & (WSP_BOT | WSP_TOP))
        {
            minwidth = frame_minwidth(topframe, NOWIN);
            available = topframe->fr_width;
            needed += minwidth;
        }
+       else if (p_ea)
+       {
+           minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
+           prevfrp = oldwin->w_frame;
+           for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+                                                       frp = frp->fr_parent)
+           {
+               if (frp->fr_layout == FR_ROW)
+               {
+                   for (frp2 = frp->fr_child; frp2 != NULL;
+                                                       frp2 = frp2->fr_next)
+                   {
+                       if (frp2 != prevfrp)
+                           minwidth += frame_minwidth(frp2, NOWIN);
+                   }
+               }
+               prevfrp = frp;
+           }
+           available = topframe->fr_width;
+           needed += minwidth;
+       }
        else
        {
            minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
@@ -798,12 +819,33 @@
        needed = wmh1 + STATUS_HEIGHT;
        if (flags & WSP_ROOM)
            needed += p_wh - wmh1;
-       if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
+       if (flags & (WSP_BOT | WSP_TOP))
        {
            minheight = frame_minheight(topframe, NOWIN) + need_status;
            available = topframe->fr_height;
            needed += minheight;
        }
+       else if (p_ea)
+       {
+           minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
+           prevfrp = oldwin->w_frame;
+           for (frp = oldwin->w_frame->fr_parent; frp != NULL;
+                                                       frp = frp->fr_parent)
+           {
+               if (frp->fr_layout == FR_COL)
+               {
+                   for (frp2 = frp->fr_child; frp2 != NULL;
+                                                       frp2 = frp2->fr_next)
+                   {
+                       if (frp2 != prevfrp)
+                           minheight += frame_minheight(frp2, NOWIN);
+                   }
+               }
+               prevfrp = frp;
+           }
+           available = topframe->fr_height;
+           needed += minheight;
+       }
        else
        {
            minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;

Raspunde prin e-mail lui