home *** CD-ROM | disk | FTP | other *** search
- To: vim-dev@vim.org
- Subject: Patch 6.1.195
- Fcc: outbox
- From: Bram Moolenaar <Bram@moolenaar.net>
- Mime-Version: 1.0
- Content-Type: text/plain; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- ------------
-
- Patch 6.1.195
- Problem: The quickfix and preview windows always keep their height, while
- other windows can't fix their height.
- Solution: Add the 'winfixheight' option, so that a fixed height can be
- specified for any window. Also fix that the wildmenu may resize a
- one-line window to a two-line window if 'ls' is zero.
- Files: runtime/doc/options.txt, runtime/optwin.vim, src/ex_cmds.c,
- src/ex_getln.c, src/globals.h, src/option.c, src/quickfix.c,
- src/screen.c, src/structs.h, src/window.c
-
-
- *** ../vim61.194/runtime/doc/options.txt Tue Apr 9 21:34:55 2002
- --- runtime/doc/options.txt Thu Sep 19 20:40:23 2002
- ***************
- *** 1,4 ****
- ! *options.txt* For Vim version 6.1. Last change: 2002 Apr 09
-
-
- VIM REFERENCE MANUAL by Bram Moolenaar
- --- 1,4 ----
- ! *options.txt* For Vim version 6.1. Last change: 2002 Sep 19
-
-
- VIM REFERENCE MANUAL by Bram Moolenaar
- ***************
- *** 1885,1890 ****
- --- 1889,1896 ----
- When mixing vertically and horizontally split windows, a minimal size
- is computed and some windows may be larger if there is room. The
- 'eadirection' option tells in which direction the size is affected.
- + Changing the height of a window can be avoided by setting
- + 'winfixheight'.
-
- *'equalprg'* *'ep'*
- 'equalprg' 'ep' string (default "")
- ***************
- *** 6175,6180 ****
- --- 6197,6213 ----
- height of the current window.
- 'winheight' applies to the current window. Use 'winminheight' to set
- the minimal height for other windows.
- +
- + *'winfixheight'* *'wfh'*
- + 'winfixheight' 'wfh' boolean (default off)
- + local to window
- + {not in Vi}
- + {not available when compiled without the +windows
- + feature}
- + Keep the window height when windows are opened or closed and
- + 'equalalways' is set. Set by default for the |preview-window| and
- + |quickfix-window|.
- + The height may be changed anyway when running out of room.
-
- *'winminheight'* *'wmh'*
- 'winminheight' 'wmh' number (default 1)
- *** ../vim61.194/runtime/optwin.vim Sun Jun 23 12:49:34 2002
- --- runtime/optwin.vim Sat Jun 22 12:09:51 2002
- ***************
- *** 389,394 ****
- --- 389,397 ----
- call append("$", " \tset wh=" . &wh)
- call append("$", "winminheight\tminimal number of lines used for any window")
- call append("$", " \tset wmh=" . &wmh)
- + call append("$", "winfixheight\tkeep the height of the window")
- + call append("$", "\t(local to window)")
- + call <SID>BinOptionL("wfh")
- if has("vertsplit")
- call append("$", "winwidth\tminimal number of columns used for the current window")
- call append("$", " \tset wiw=" . &wiw)
- *** ../vim61.194/src/ex_cmds.c Sat Sep 7 17:16:30 2002
- --- src/ex_cmds.c Sat Sep 7 17:11:47 2002
- ***************
- *** 4365,4370 ****
- --- 4365,4371 ----
- == FAIL)
- return;
- curwin->w_p_pvw = TRUE;
- + curwin->w_p_wfh = TRUE;
- }
- }
- }
- *** ../vim61.194/src/ex_getln.c Mon Sep 16 22:00:32 2002
- --- src/ex_getln.c Sat Sep 7 14:58:21 2002
- ***************
- *** 366,373 ****
- }
- else if (save_p_ls != -1)
- {
- ! /* restore 'laststatus' if it was changed */
- p_ls = save_p_ls;
- last_status(FALSE);
- update_screen(VALID); /* redraw the screen NOW */
- redrawcmd();
- --- 366,374 ----
- }
- else if (save_p_ls != -1)
- {
- ! /* restore 'laststatus' and 'winminheight' */
- p_ls = save_p_ls;
- + p_wmh = save_p_wmh;
- last_status(FALSE);
- update_screen(VALID); /* redraw the screen NOW */
- redrawcmd();
- *** ../vim61.194/src/globals.h Sat May 4 22:23:07 2002
- --- src/globals.h Sun May 12 17:01:21 2002
- ***************
- *** 821,826 ****
- --- 821,827 ----
-
- #ifdef FEAT_WILDMENU
- EXTERN int save_p_ls INIT(= -1); /* Save 'laststatus' setting */
- + EXTERN int save_p_wmh INIT(= -1); /* Save 'winminheight' setting */
- EXTERN int wild_menu_showing INIT(= 0);
- #define WM_SHOWN 1 /* wildmenu showing */
- #define WM_SCROLLED 2 /* wildmenu showing with scroll */
- *** ../vim61.194/src/option.c Thu Aug 22 20:34:03 2002
- --- src/option.c Fri Sep 20 21:56:21 2002
- ***************
- *** 121,126 ****
- --- 121,127 ----
- , PV_TSR
- , PV_TW
- , PV_TX
- + , PV_WFH
- , PV_WM
- , PV_WRAP
- } idopt_T;
- ***************
- *** 2150,2155 ****
- --- 2153,2165 ----
- (char_u *)NULL, PV_NONE,
- #endif
- {(char_u *)1L, (char_u *)0L}},
- + {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT,
- + #if defined(FEAT_WINDOWS)
- + (char_u *)VAR_WIN, PV_WFH,
- + #else
- + (char_u *)NULL, PV_NONE,
- + #endif
- + {(char_u *)FALSE, (char_u *)0L}},
- {"winminheight", "wmh", P_NUM|P_VI_DEF,
- #ifdef FEAT_WINDOWS
- (char_u *)&p_wmh, PV_NONE,
- ***************
- *** 7198,7203 ****
- --- 7208,7216 ----
- case PV_FMR: return (char_u *)&(curwin->w_p_fmr);
- #endif
- case PV_NU: return (char_u *)&(curwin->w_p_nu);
- + #if defined(FEAT_WINDOWS)
- + case PV_WFH: return (char_u *)&(curwin->w_p_wfh);
- + #endif
- #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
- case PV_PVW: return (char_u *)&(curwin->w_p_pvw);
- #endif
- *** ../vim61.194/src/quickfix.c Tue Apr 23 22:43:00 2002
- --- src/quickfix.c Sun May 12 15:33:48 2002
- ***************
- *** 1592,1597 ****
- --- 1592,1598 ----
- /* Only set the height when there is no window to the side. */
- if (curwin->w_width == Columns)
- win_setheight(height);
- + curwin->w_p_wfh = TRUE; /* set 'winfixheight' */
- }
-
- /*
- *** ../vim61.194/src/screen.c Mon Sep 16 21:17:43 2002
- --- src/screen.c Sat Sep 14 22:02:25 2002
- ***************
- *** 4679,4689 ****
- }
- else
- {
- ! /* create status line if needed */
- if (lastwin->w_status_height == 0)
- {
- save_p_ls = p_ls;
- p_ls = 2;
- last_status(FALSE);
- }
- wild_menu_showing = WM_SHOWN;
- --- 4679,4693 ----
- }
- else
- {
- ! /* Create status line if needed by setting 'laststatus' to 2.
- ! * Set 'winminheight' to zero to avoid that the window is
- ! * resized. */
- if (lastwin->w_status_height == 0)
- {
- save_p_ls = p_ls;
- + save_p_wmh = p_wmh;
- p_ls = 2;
- + p_wmh = 0;
- last_status(FALSE);
- }
- wild_menu_showing = WM_SHOWN;
- *** ../vim61.194/src/structs.h Sun Aug 18 16:05:35 2002
- --- src/structs.h Sat Aug 3 21:13:33 2002
- ***************
- *** 156,161 ****
- --- 156,165 ----
- #define w_p_list w_onebuf_opt.wo_list /* 'list' */
- int wo_nu;
- #define w_p_nu w_onebuf_opt.wo_nu /* 'number' */
- + #if defined(FEAT_WINDOWS)
- + int wo_wfh;
- + # define w_p_wfh w_onebuf_opt.wo_wfh /* 'winfixheight' */
- + #endif
- #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
- int wo_pvw;
- # define w_p_pvw w_onebuf_opt.wo_pvw /* 'previewwindow' */
- ***************
- *** 1129,1134 ****
- --- 1135,1141 ----
- int fr_width;
- #endif
- int fr_height;
- + int fr_newheight; /* new height used in win_equal_rec() */
- frame_T *fr_parent; /* containing frame or NULL */
- frame_T *fr_next; /* frame right or below in same parent, NULL
- for first */
- *** ../vim61.194/src/window.c Sun Jul 21 21:47:39 2002
- --- src/window.c Mon Jun 24 21:34:44 2002
- ***************
- *** 30,36 ****
- static frame_T *win_altframe __ARGS((win_T *win));
- static win_T *frame2win __ARGS((frame_T *frp));
- static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
- ! static void frame_new_height __ARGS((frame_T *topfrp, int height, int topfirst));
- #ifdef FEAT_VERTSPLIT
- static void frame_add_statusline __ARGS((frame_T *frp));
- static void frame_new_width __ARGS((frame_T *topfrp, int width, int leftfirst));
- --- 30,37 ----
- static frame_T *win_altframe __ARGS((win_T *win));
- static win_T *frame2win __ARGS((frame_T *frp));
- static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
- ! static void frame_new_height __ARGS((frame_T *topfrp, int height, int topfirst, int wfh));
- ! static int frame_fixed_height __ARGS((frame_T *frp));
- #ifdef FEAT_VERTSPLIT
- static void frame_add_statusline __ARGS((frame_T *frp));
- static void frame_new_width __ARGS((frame_T *topfrp, int width, int leftfirst));
- ***************
- *** 717,734 ****
- /* if it doesn't fit in the current window, need win_equal() */
- if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
- do_equal = TRUE;
- ! #ifdef FEAT_QUICKFIX
- ! /* We don't like to take lines for the new window from a quickfix
- ! * or preview window. Take them from a window above or below
- * instead, if possible. */
- ! if (bt_quickfix(oldwin->w_buffer) || oldwin->w_p_pvw)
- {
- ! win_setheight_win(oldwin->w_height + new_size, oldwin);
- oldwin_height = oldwin->w_height;
- if (need_status)
- oldwin_height -= STATUS_HEIGHT;
- }
- - #endif
- }
-
- /*
- --- 718,735 ----
- /* if it doesn't fit in the current window, need win_equal() */
- if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
- do_equal = TRUE;
- !
- ! /* We don't like to take lines for the new window from a
- ! * 'winfixheight' window. Take them from a window above or below
- * instead, if possible. */
- ! if (oldwin->w_p_wfh)
- {
- ! win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
- ! oldwin);
- oldwin_height = oldwin->w_height;
- if (need_status)
- oldwin_height -= STATUS_HEIGHT;
- }
- }
-
- /*
- ***************
- *** 964,970 ****
- win_new_height(wp, new_size);
- if (flags & (WSP_TOP | WSP_BOT))
- frame_new_height(curfrp, curfrp->fr_height
- ! - (new_size + STATUS_HEIGHT), flags & WSP_TOP);
- else
- win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
- if (before) /* new window above current one */
- --- 965,971 ----
- win_new_height(wp, new_size);
- if (flags & (WSP_TOP | WSP_BOT))
- frame_new_height(curfrp, curfrp->fr_height
- ! - (new_size + STATUS_HEIGHT), flags & WSP_TOP, FALSE);
- else
- win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
- if (before) /* new window above current one */
- ***************
- *** 1402,1407 ****
- --- 1403,1409 ----
- int flags;
- {
- int dir;
- + int height = curwin->w_height;
-
- if (lastwin == firstwin)
- {
- ***************
- *** 1412,1421 ****
- /* Remove the window and frame from the tree of frames. */
- (void)winframe_remove(curwin, &dir);
- win_remove(curwin);
- ! (void)win_comp_pos();
-
- /* Split a window on the right side and put the window there. */
- (void)win_split_ins(size, flags, curwin, dir);
-
- #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
- /* When 'guioptions' includes 'L' or 'R' may have to remove or add
- --- 1414,1425 ----
- /* Remove the window and frame from the tree of frames. */
- (void)winframe_remove(curwin, &dir);
- win_remove(curwin);
- ! last_status(FALSE); /* may need to remove last status line */
- ! (void)win_comp_pos(); /* recompute window positions */
-
- /* Split a window on the right side and put the window there. */
- (void)win_split_ins(size, flags, curwin, dir);
- + win_setheight(height);
-
- #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
- /* When 'guioptions' includes 'L' or 'R' may have to remove or add
- ***************
- *** 1526,1535 ****
- int next_curwin_size = 0;
- int room = 0;
- int new_size;
- - #ifdef FEAT_QUICKFIX
- - int quickfix_height = 0;
- - int preview_height = 0;
- - #endif
- int has_next_curwin = 0;
- int hnc;
-
- --- 1530,1535 ----
- ***************
- *** 1544,1550 ****
- )
- {
- topfr->fr_win->w_winrow = row;
- ! frame_new_height(topfr, height, FALSE);
- #ifdef FEAT_VERTSPLIT
- topfr->fr_win->w_wincol = col;
- frame_new_width(topfr, width, FALSE);
- --- 1544,1550 ----
- )
- {
- topfr->fr_win->w_winrow = row;
- ! frame_new_height(topfr, height, FALSE, FALSE);
- #ifdef FEAT_VERTSPLIT
- topfr->fr_win->w_wincol = col;
- frame_new_width(topfr, width, FALSE);
- ***************
- *** 1672,1690 ****
- }
- else
- {
- - #ifdef FEAT_QUICKFIX
- next_curwin_size = -1;
- for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
- {
- ! /* The quickfix and preview window keep their height if
- * possible.
- * Watch out for this window being the next_curwin. */
- ! if (fr->fr_win != NULL
- ! && (bt_quickfix(fr->fr_win->w_buffer)
- ! || fr->fr_win->w_p_pvw))
- {
- new_size = fr->fr_height;
- ! if (fr->fr_win == next_curwin)
- {
- room += p_wh - p_wmh;
- next_curwin_size = 0;
- --- 1672,1688 ----
- }
- else
- {
- next_curwin_size = -1;
- for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
- {
- ! /* If 'winfixheight' set keep the window height if
- * possible.
- * Watch out for this window being the next_curwin. */
- ! if (frame_fixed_height(fr))
- {
- + n = frame_minheight(fr, NOWIN);
- new_size = fr->fr_height;
- ! if (frame_has_win(fr, next_curwin))
- {
- room += p_wh - p_wmh;
- next_curwin_size = 0;
- ***************
- *** 1692,1712 ****
- new_size = p_wh;
- }
- else
- ! --totwincount;
- ! room -= new_size - p_wmh - fr->fr_win->w_status_height;
- if (room < 0)
- {
- new_size += room;
- room = 0;
- }
- ! if (fr->fr_win->w_p_pvw)
- ! preview_height = new_size;
- ! else
- ! quickfix_height = new_size;
- }
- }
- if (next_curwin_size == -1)
- - #endif
- {
- if (!has_next_curwin)
- next_curwin_size = 0;
- --- 1690,1708 ----
- new_size = p_wh;
- }
- else
- ! /* These windows don't use up room. */
- ! totwincount -= (n + (fr->fr_next == NULL
- ! ? extra_sep : 0)) / (p_wmh + 1);
- ! room -= new_size - n;
- if (room < 0)
- {
- new_size += room;
- room = 0;
- }
- ! fr->fr_newheight = new_size;
- }
- }
- if (next_curwin_size == -1)
- {
- if (!has_next_curwin)
- next_curwin_size = 0;
- ***************
- *** 1736,1753 ****
- new_size = height;
- else if (dir == 'h')
- new_size = fr->fr_height;
- ! #ifdef FEAT_QUICKFIX
- ! else if (fr->fr_win != NULL && bt_quickfix(fr->fr_win->w_buffer))
- ! {
- ! new_size = quickfix_height;
- ! wincount = 0; /* doesn't count as a sizeable window */
- ! }
- ! else if (fr->fr_win != NULL && fr->fr_win->w_p_pvw)
- {
- ! new_size = preview_height;
- wincount = 0; /* doesn't count as a sizeable window */
- }
- - #endif
- else
- {
- /* Compute the maximum number of windows vert. in "fr". */
- --- 1732,1742 ----
- new_size = height;
- else if (dir == 'h')
- new_size = fr->fr_height;
- ! else if (frame_fixed_height(fr))
- {
- ! new_size = fr->fr_newheight;
- wincount = 0; /* doesn't count as a sizeable window */
- }
- else
- {
- /* Compute the maximum number of windows vert. in "fr". */
- ***************
- *** 1974,1979 ****
- --- 1963,1969 ----
- frame_T *frp, *frp2, *frp3;
- frame_T *frp_close = win->w_frame;
- win_T *wp;
- + int old_height = 0;
-
- /*
- * Remove the window from its frame.
- ***************
- *** 1998,2022 ****
- if (frp_close->fr_parent->fr_layout == FR_COL)
- {
- #endif
- ! #ifdef FEAT_QUICKFIX
- ! int old_height = 0;
- !
- ! /* For a preview or quickfix window, remember its old size and restore
- * it later (it's a simplistic solution...). Don't do this if the
- * window will occupy the full height of the screen. */
- if (frp2->fr_win != NULL
- ! && (frp2->fr_next != NULL
- ! || frp2->fr_prev != NULL)
- ! && (frp2->fr_win->w_p_pvw
- ! || bt_quickfix(frp2->fr_win->w_buffer)))
- old_height = frp2->fr_win->w_height;
- - #endif
- frame_new_height(frp2, frp2->fr_height + frp_close->fr_height,
- ! frp2 == frp_close->fr_next ? TRUE : FALSE);
- ! #ifdef FEAT_QUICKFIX
- if (old_height != 0)
- win_setheight_win(old_height, frp2->fr_win);
- - #endif
- #ifdef FEAT_VERTSPLIT
- *dirp = 'v';
- }
- --- 1988,2004 ----
- if (frp_close->fr_parent->fr_layout == FR_COL)
- {
- #endif
- ! /* When 'winfixheight' is set, remember its old size and restore
- * it later (it's a simplistic solution...). Don't do this if the
- * window will occupy the full height of the screen. */
- if (frp2->fr_win != NULL
- ! && (frp2->fr_next != NULL || frp2->fr_prev != NULL)
- ! && frp2->fr_win->w_p_wfh)
- old_height = frp2->fr_win->w_height;
- frame_new_height(frp2, frp2->fr_height + frp_close->fr_height,
- ! frp2 == frp_close->fr_next ? TRUE : FALSE, FALSE);
- if (old_height != 0)
- win_setheight_win(old_height, frp2->fr_win);
- #ifdef FEAT_VERTSPLIT
- *dirp = 'v';
- }
- ***************
- *** 2133,2142 ****
- * frames and windows. Caller must take care of positions.
- */
- static void
- ! frame_new_height(topfrp, height, topfirst)
- frame_T *topfrp;
- int height;
- int topfirst; /* resize topmost contained frame first */
- {
- frame_T *frp;
- int extra_lines;
- --- 2115,2126 ----
- * frames and windows. Caller must take care of positions.
- */
- static void
- ! frame_new_height(topfrp, height, topfirst, wfh)
- frame_T *topfrp;
- int height;
- int topfirst; /* resize topmost contained frame first */
- + int wfh; /* obey 'winfixheight' when there is a choice;
- + may cause the height not to be set */
- {
- frame_T *frp;
- int extra_lines;
- ***************
- *** 2153,2159 ****
- {
- /* All frames in this row get the same new height. */
- for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
- ! frame_new_height(frp, height, topfirst);
- }
- #endif
- else
- --- 2137,2143 ----
- {
- /* All frames in this row get the same new height. */
- for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
- ! frame_new_height(frp, height, topfirst, wfh);
- }
- #endif
- else
- ***************
- *** 2162,2205 ****
- * frame first, frames above that when needed. */
-
- frp = topfrp->fr_child;
- if (!topfirst)
- /* Find the bottom frame of this column */
- while (frp->fr_next != NULL)
- frp = frp->fr_next;
-
- extra_lines = height - topfrp->fr_height;
- if (extra_lines < 0)
- {
- ! /* reduce frame height, bottom frame first */
- while (frp != NULL)
- {
- h = frame_minheight(frp, NULL);
- if (frp->fr_height + extra_lines < h)
- {
- extra_lines += frp->fr_height - h;
- ! frame_new_height(frp, h, topfirst);
- }
- else
- {
- frame_new_height(frp, frp->fr_height + extra_lines,
- ! topfirst);
- break;
- }
- if (topfirst)
- ! frp = frp->fr_next;
- else
- ! frp = frp->fr_prev;
- }
- }
- else if (extra_lines > 0)
- {
- /* increase height of bottom or top frame */
- ! frame_new_height(frp, frp->fr_height + extra_lines, topfirst);
- }
- }
- topfrp->fr_height = height;
- }
-
- #ifdef FEAT_VERTSPLIT
- /*
- * Add a status line to windows at the bottom of "frp".
- --- 2146,2244 ----
- * frame first, frames above that when needed. */
-
- frp = topfrp->fr_child;
- + if (wfh)
- + /* Advance past frames with one window with 'wfh' set. */
- + while (frame_fixed_height(frp))
- + {
- + frp = frp->fr_next;
- + if (frp == NULL)
- + return; /* no frame without 'wfh', give up */
- + }
- if (!topfirst)
- + {
- /* Find the bottom frame of this column */
- while (frp->fr_next != NULL)
- frp = frp->fr_next;
- + if (wfh)
- + /* Advance back for frames with one window with 'wfh' set. */
- + while (frame_fixed_height(frp))
- + frp = frp->fr_prev;
- + }
-
- extra_lines = height - topfrp->fr_height;
- if (extra_lines < 0)
- {
- ! /* reduce height of contained frames, bottom or top frame first */
- while (frp != NULL)
- {
- h = frame_minheight(frp, NULL);
- if (frp->fr_height + extra_lines < h)
- {
- extra_lines += frp->fr_height - h;
- ! frame_new_height(frp, h, topfirst, wfh);
- }
- else
- {
- frame_new_height(frp, frp->fr_height + extra_lines,
- ! topfirst, wfh);
- break;
- }
- if (topfirst)
- ! {
- ! do
- ! frp = frp->fr_next;
- ! while (wfh && frp != NULL && frame_fixed_height(frp));
- ! }
- else
- ! {
- ! do
- ! frp = frp->fr_prev;
- ! while (wfh && frp != NULL && frame_fixed_height(frp));
- ! }
- ! /* Increase "height" if we could not reduce enough frames. */
- ! if (frp == NULL)
- ! height -= extra_lines;
- }
- }
- else if (extra_lines > 0)
- {
- /* increase height of bottom or top frame */
- ! frame_new_height(frp, frp->fr_height + extra_lines, topfirst, wfh);
- }
- }
- topfrp->fr_height = height;
- }
-
- + /*
- + * Return TRUE if height of frame "frp" should not be changed because of
- + * the 'winfixheight' option.
- + */
- + static int
- + frame_fixed_height(frp)
- + frame_T *frp;
- + {
- + /* frame with one window: fixed height if 'winfixheight' set. */
- + if (frp->fr_win != NULL)
- + return frp->fr_win->w_p_wfh;
- +
- + if (frp->fr_layout == FR_ROW)
- + {
- + /* The frame is fixed height if one of the frames in the row is fixed
- + * height. */
- + for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
- + if (frame_fixed_height(frp))
- + return TRUE;
- + return FALSE;
- + }
- +
- + /* frp->fr_layout == FR_COL: The frame is fixed height if all of the
- + * frames in the row are fixed height. */
- + for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
- + if (!frame_fixed_height(frp))
- + return FALSE;
- + return TRUE;
- + }
- +
- #ifdef FEAT_VERTSPLIT
- /*
- * Add a status line to windows at the bottom of "frp".
- ***************
- *** 2904,2910 ****
- redraw_later(VALID); /* causes status line redraw */
-
- /* set window height to desired minimal value */
- ! if (curwin->w_height < p_wh)
- win_setheight((int)p_wh);
-
- #ifdef FEAT_VERTSPLIT
- --- 2943,2949 ----
- redraw_later(VALID); /* causes status line redraw */
-
- /* set window height to desired minimal value */
- ! if (curwin->w_height < p_wh && !curwin->w_p_wfh)
- win_setheight((int)p_wh);
-
- #ifdef FEAT_VERTSPLIT
- ***************
- *** 3204,3210 ****
- #ifdef FEAT_WINDOWS
- if (h < frame_minheight(topframe, NULL))
- h = frame_minheight(topframe, NULL);
- ! frame_new_height(topframe, h, FALSE);
- (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
- #else
- if (h < 1)
- --- 3243,3254 ----
- #ifdef FEAT_WINDOWS
- if (h < frame_minheight(topframe, NULL))
- h = frame_minheight(topframe, NULL);
- ! /* First try setting the heights of windows without 'winfixheight'. If
- ! * that doesn't result in the right height, forget about that option. */
- ! frame_new_height(topframe, h, FALSE, TRUE);
- ! if (topframe->fr_height != h)
- ! frame_new_height(topframe, h, FALSE, FALSE);
- !
- (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
- #else
- if (h < 1)
- ***************
- *** 3443,3451 ****
- int run;
- frame_T *frp;
- int h;
- - #ifdef FEAT_QUICKFIX
- int room_reserved;
- - #endif
-
- /* If the height already is the desired value, nothing to do. */
- if (curfrp->fr_height == height)
- --- 3487,3493 ----
- ***************
- *** 3457,3463 ****
- if (height > Rows - p_ch)
- height = Rows - p_ch;
- if (height > 0)
- ! frame_new_height(curfrp, height, FALSE);
- }
- else if (curfrp->fr_parent->fr_layout == FR_ROW)
- {
- --- 3499,3505 ----
- if (height > Rows - p_ch)
- height = Rows - p_ch;
- if (height > 0)
- ! frame_new_height(curfrp, height, FALSE, FALSE);
- }
- else if (curfrp->fr_parent->fr_layout == FR_ROW)
- {
- ***************
- *** 3479,3485 ****
- * 1: compute room available, if it's not enough try resizing the
- * containing frame.
- * 2: compute the room available and adjust the height to it.
- ! * Try not to reduce the height of the quickfix and preview window.
- */
- for (run = 1; run <= 2; ++run)
- #else
- --- 3521,3527 ----
- * 1: compute room available, if it's not enough try resizing the
- * containing frame.
- * 2: compute the room available and adjust the height to it.
- ! * Try not to reduce the height of a window with 'winfixheight' set.
- */
- for (run = 1; run <= 2; ++run)
- #else
- ***************
- *** 3487,3505 ****
- #endif
- {
- room = 0;
- - #ifdef FEAT_QUICKFIX
- room_reserved = 0;
- - #endif
- for (frp = curfrp->fr_parent->fr_child; frp != NULL;
- frp = frp->fr_next)
- {
- - #ifdef FEAT_QUICKFIX
- if (frp != curfrp
- && frp->fr_win != NULL
- ! && (frp->fr_win->w_p_pvw
- ! || bt_quickfix(frp->fr_win->w_buffer)))
- room_reserved += frp->fr_height;
- - #endif
- room += frp->fr_height;
- if (frp != curfrp)
- room -= frame_minheight(frp, NULL);
- --- 3529,3542 ----
- #endif
- {
- room = 0;
- room_reserved = 0;
- for (frp = curfrp->fr_parent->fr_child; frp != NULL;
- frp = frp->fr_next)
- {
- if (frp != curfrp
- && frp->fr_win != NULL
- ! && frp->fr_win->w_p_wfh)
- room_reserved += frp->fr_height;
- room += frp->fr_height;
- if (frp != curfrp)
- room -= frame_minheight(frp, NULL);
- ***************
- *** 3539,3554 ****
- */
- take = height - curfrp->fr_height;
-
- ! #ifdef FEAT_QUICKFIX
- ! /* If there is not enough room, also reduce the height of quickfix and
- ! * preview window. */
- if (height > room + room_cmdline - room_reserved)
- room_reserved = room + room_cmdline - height;
- ! /* If there is only a quickfix or preview window and making the
- * window smaller, need to make the other window taller. */
- if (take < 0 && room - curfrp->fr_height < room_reserved)
- room_reserved = 0;
- - #endif
-
- if (take > 0 && room_cmdline > 0)
- {
- --- 3576,3589 ----
- */
- take = height - curfrp->fr_height;
-
- ! /* If there is not enough room, also reduce the height of a window
- ! * with 'winfixheight' set. */
- if (height > room + room_cmdline - room_reserved)
- room_reserved = room + room_cmdline - height;
- ! /* If there is only a 'winfixheight' window and making the
- * window smaller, need to make the other window taller. */
- if (take < 0 && room - curfrp->fr_height < room_reserved)
- room_reserved = 0;
-
- if (take > 0 && room_cmdline > 0)
- {
- ***************
- *** 3562,3568 ****
- /*
- * set the current frame to the new height
- */
- ! frame_new_height(curfrp, height, FALSE);
-
- /*
- * First take lines from the frames after the current frame. If
- --- 3597,3603 ----
- /*
- * set the current frame to the new height
- */
- ! frame_new_height(curfrp, height, FALSE, FALSE);
-
- /*
- * First take lines from the frames after the current frame. If
- ***************
- *** 3578,3588 ****
- while (frp != NULL && take != 0)
- {
- h = frame_minheight(frp, NULL);
- - #ifdef FEAT_QUICKFIX
- if (room_reserved > 0
- && frp->fr_win != NULL
- ! && (frp->fr_win->w_p_pvw
- ! || bt_quickfix(frp->fr_win->w_buffer)))
- {
- if (room_reserved >= frp->fr_height)
- room_reserved -= frp->fr_height;
- --- 3613,3621 ----
- while (frp != NULL && take != 0)
- {
- h = frame_minheight(frp, NULL);
- if (room_reserved > 0
- && frp->fr_win != NULL
- ! && frp->fr_win->w_p_wfh)
- {
- if (room_reserved >= frp->fr_height)
- room_reserved -= frp->fr_height;
- ***************
- *** 3591,3611 ****
- if (frp->fr_height - room_reserved > take)
- room_reserved = frp->fr_height - take;
- take -= frp->fr_height - room_reserved;
- ! frame_new_height(frp, room_reserved, FALSE);
- room_reserved = 0;
- }
- }
- else
- - #endif
- {
- if (frp->fr_height - take < h)
- {
- take -= frp->fr_height - h;
- ! frame_new_height(frp, h, FALSE);
- }
- else
- {
- ! frame_new_height(frp, frp->fr_height - take, FALSE);
- take = 0;
- }
- }
- --- 3624,3644 ----
- if (frp->fr_height - room_reserved > take)
- room_reserved = frp->fr_height - take;
- take -= frp->fr_height - room_reserved;
- ! frame_new_height(frp, room_reserved, FALSE, FALSE);
- room_reserved = 0;
- }
- }
- else
- {
- if (frp->fr_height - take < h)
- {
- take -= frp->fr_height - h;
- ! frame_new_height(frp, h, FALSE, FALSE);
- }
- else
- {
- ! frame_new_height(frp, frp->fr_height - take,
- ! FALSE, FALSE);
- take = 0;
- }
- }
- ***************
- *** 3877,3883 ****
- * Doesn't happen when dragging the last status line up.
- */
- if (fr != NULL)
- ! frame_new_height(fr, fr->fr_height + offset, up);
-
- if (up)
- fr = curfr; /* current frame gets smaller */
- --- 3910,3916 ----
- * Doesn't happen when dragging the last status line up.
- */
- if (fr != NULL)
- ! frame_new_height(fr, fr->fr_height + offset, up, FALSE);
-
- if (up)
- fr = curfr; /* current frame gets smaller */
- ***************
- *** 3893,3903 ****
- if (fr->fr_height - offset <= n)
- {
- offset -= fr->fr_height - n;
- ! frame_new_height(fr, n, !up);
- }
- else
- {
- ! frame_new_height(fr, fr->fr_height - offset, !up);
- break;
- }
- if (up)
- --- 3926,3936 ----
- if (fr->fr_height - offset <= n)
- {
- offset -= fr->fr_height - n;
- ! frame_new_height(fr, n, !up, FALSE);
- }
- else
- {
- ! frame_new_height(fr, fr->fr_height - offset, !up, FALSE);
- break;
- }
- if (up)
- ***************
- *** 4174,4183 ****
-
- /* Find bottom frame with width of screen. */
- frp = lastwin->w_frame;
- ! #ifdef FEAT_VERTSPLIT
- while (frp->fr_width != Columns && frp->fr_parent != NULL)
- frp = frp->fr_parent;
- ! #endif
-
- if (starting != NO_SCREEN)
- {
- --- 4207,4221 ----
-
- /* Find bottom frame with width of screen. */
- frp = lastwin->w_frame;
- ! # ifdef FEAT_VERTSPLIT
- while (frp->fr_width != Columns && frp->fr_parent != NULL)
- frp = frp->fr_parent;
- ! # endif
- !
- ! /* Avoid changing the height of a window with 'winfixheight' set. */
- ! while (frp->fr_prev != NULL && frp->fr_layout == FR_LEAF
- ! && frp->fr_win->w_p_wfh)
- ! frp = frp->fr_prev;
-
- if (starting != NO_SCREEN)
- {
- ***************
- *** 4219,4224 ****
- --- 4257,4266 ----
- redraw_cmdline = TRUE;
- }
- frame_add_height(frp, (int)(old_p_ch - p_ch));
- +
- + /* Recompute window positions. */
- + if (frp != lastwin->w_frame)
- + (void)win_comp_pos();
- #else
- win_setheight((int)(firstwin->w_height + old_p_ch - p_ch));
- cmdline_row = Rows - p_ch;
- ***************
- *** 4235,4241 ****
- frame_T *frp;
- int n;
- {
- ! frame_new_height(frp, frp->fr_height + n, FALSE);
- for (;;)
- {
- frp = frp->fr_parent;
- --- 4277,4283 ----
- frame_T *frp;
- int n;
- {
- ! frame_new_height(frp, frp->fr_height + n, FALSE, FALSE);
- for (;;)
- {
- frp = frp->fr_parent;
- ***************
- *** 4297,4303 ****
- wp->w_status_height = 1;
- if (fp != fr)
- {
- ! frame_new_height(fp, fp->fr_height - 1, FALSE);
- frame_fix_height(wp);
- (void)win_comp_pos();
- }
- --- 4339,4345 ----
- wp->w_status_height = 1;
- if (fp != fr)
- {
- ! frame_new_height(fp, fp->fr_height - 1, FALSE, FALSE);
- frame_fix_height(wp);
- (void)win_comp_pos();
- }
- ***************
- *** 4801,4807 ****
- # endif
- if (fr->fr_layout == FR_LEAF)
- {
- ! frame_new_height(fr, fr->fr_height, FALSE);
- # ifdef FEAT_VERTSPLIT
- frame_new_width(fr, fr->fr_width, FALSE);
- # endif
- --- 4843,4849 ----
- # endif
- if (fr->fr_layout == FR_LEAF)
- {
- ! frame_new_height(fr, fr->fr_height, FALSE, FALSE);
- # ifdef FEAT_VERTSPLIT
- frame_new_width(fr, fr->fr_width, FALSE);
- # endif
- *** ../vim61.194/src/version.c Mon Sep 23 21:19:48 2002
- --- src/version.c Mon Sep 23 21:24:21 2002
- ***************
- *** 608,609 ****
- --- 608,611 ----
- { /* Add new patch number below this line */
- + /**/
- + 195,
- /**/
-
- --
- Tips for aliens in New York: Land anywhere. Central Park, anywhere.
- No one will care or indeed even notice.
- -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
-
- /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\
- /// Creator of Vim - Vi IMproved -- http://www.vim.org \\\
- \\\ Project leader for A-A-P -- http://www.a-a-p.org ///
- \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
-