On Wed, Jul 16, 2014 at 9:35 AM, Yukihiro Nakadaira < yukihiro.nakada...@gmail.com> wrote > > I found another problem that zero width/height current window is created. > hmm... > > $ vim -u NONE -N > :set noequalalways winminheight=0 > :while 1 | split | endwhile > > $ vim -u NONE -N > :set noequalalways winminwidth=0 > :while 1 | vsplit | endwhile > > I wrote patch for this problem. This patch contains a few cleaning up for previous patch. 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 616723e9f486 src/window.c --- a/src/window.c Wed Jul 16 17:01:54 2014 +0200 +++ b/src/window.c Thu Jul 17 00:10:50 2014 +0900 @@ -688,6 +688,8 @@ int before; int minwidth; int minheight; + int wmw1; + int wmh1; if (flags & WSP_TOP) oldwin = firstwin; @@ -722,19 +724,22 @@ * Check if we are able to split the current window and compute its * width. */ - needed = p_wmw + 1; + /* Current window requires at least 1 space. */ + wmw1 = (p_wmw == 0 ? 1 : p_wmw); + needed = wmw1 + 1; if (flags & WSP_ROOM) - needed += p_wiw - p_wmw; + needed += p_wiw - wmw1; if (p_ea || (flags & (WSP_BOT | WSP_TOP))) { - minwidth = frame_minwidth(topframe, NULL); + minwidth = frame_minwidth(topframe, NOWIN); available = topframe->fr_width; needed += minwidth; } else { - minwidth = frame_minwidth(oldwin->w_frame, NULL); - available = oldwin->w_width; + minwidth = frame_minwidth(oldwin->w_frame, NOWIN); + available = oldwin->w_frame->fr_width; + needed += minwidth; } if (available < needed && new_wp == NULL) { @@ -743,12 +748,10 @@ } if (new_size == 0) new_size = oldwin->w_width / 2; - if (new_size > oldwin->w_width - p_wmw - 1) - new_size = oldwin->w_width - p_wmw - 1; if (new_size > available - minwidth - 1) new_size = available - minwidth - 1; - if (new_size < p_wmw) - new_size = p_wmw; + if (new_size < wmw1) + new_size = wmw1; /* if it doesn't fit in the current window, need win_equal() */ if (oldwin->w_width - new_size - 1 < p_wmw) @@ -789,20 +792,22 @@ * Check if we are able to split the current window and compute its * height. */ - needed = p_wmh + STATUS_HEIGHT + need_status; + /* Current window requires at least 1 space. */ + wmh1 = (p_wmh == 0 ? 1 : p_wmh); + needed = wmh1 + STATUS_HEIGHT; if (flags & WSP_ROOM) - needed += p_wh - p_wmh; + needed += p_wh - wmh1; if (p_ea || (flags & (WSP_BOT | WSP_TOP))) { - minheight = frame_minheight(topframe, NULL); + minheight = frame_minheight(topframe, NOWIN) + need_status; available = topframe->fr_height; needed += minheight; } else { - minheight = frame_minheight(oldwin->w_frame, NULL); - available = oldwin->w_height; - needed += p_wmh; + minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status; + available = oldwin->w_frame->fr_height; + needed += minheight; } if (available < needed && new_wp == NULL) { @@ -817,13 +822,10 @@ } if (new_size == 0) new_size = oldwin_height / 2; - - if (new_size > oldwin_height - p_wmh - STATUS_HEIGHT) - new_size = oldwin_height - p_wmh - STATUS_HEIGHT; if (new_size > available - minheight - STATUS_HEIGHT) new_size = available - minheight - STATUS_HEIGHT; - if (new_size < p_wmh) - new_size = p_wmh; + if (new_size < wmh1) + new_size = wmh1; /* if it doesn't fit in the current window, need win_equal() */ if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)