home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.1.195 < prev    next >
Encoding:
Internet Message Format  |  2002-09-22  |  31.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.195
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.1.195
  11. Problem:    The quickfix and preview windows always keep their height, while
  12.         other windows can't fix their height.
  13. Solution:   Add the 'winfixheight' option, so that a fixed height can be
  14.         specified for any window.  Also fix that the wildmenu may resize a
  15.         one-line window to a two-line window if 'ls' is zero.
  16. Files:        runtime/doc/options.txt, runtime/optwin.vim, src/ex_cmds.c,
  17.         src/ex_getln.c, src/globals.h, src/option.c, src/quickfix.c,
  18.         src/screen.c, src/structs.h, src/window.c
  19.  
  20.  
  21. *** ../vim61.194/runtime/doc/options.txt    Tue Apr  9 21:34:55 2002
  22. --- runtime/doc/options.txt    Thu Sep 19 20:40:23 2002
  23. ***************
  24. *** 1,4 ****
  25. ! *options.txt*   For Vim version 6.1.  Last change: 2002 Apr 09
  26.   
  27.   
  28.             VIM REFERENCE MANUAL    by Bram Moolenaar
  29. --- 1,4 ----
  30. ! *options.txt*   For Vim version 6.1.  Last change: 2002 Sep 19
  31.   
  32.   
  33.             VIM REFERENCE MANUAL    by Bram Moolenaar
  34. ***************
  35. *** 1885,1890 ****
  36. --- 1889,1896 ----
  37.       When mixing vertically and horizontally split windows, a minimal size
  38.       is computed and some windows may be larger if there is room.  The
  39.       'eadirection' option tells in which direction the size is affected.
  40. +     Changing the height of a window can be avoided by setting
  41. +     'winfixheight'.
  42.   
  43.                           *'equalprg'* *'ep'*
  44.   'equalprg' 'ep'        string    (default "")
  45. ***************
  46. *** 6175,6180 ****
  47. --- 6197,6213 ----
  48.       height of the current window.
  49.       'winheight' applies to the current window.  Use 'winminheight' to set
  50.       the minimal height for other windows.
  51. +                         *'winfixheight'* *'wfh'*
  52. + 'winfixheight' 'wfh'    boolean    (default off)
  53. +             local to window
  54. +             {not in Vi}
  55. +             {not available when compiled without the +windows
  56. +             feature}
  57. +     Keep the window height when windows are opened or closed and
  58. +     'equalalways' is set.  Set by default for the |preview-window| and
  59. +     |quickfix-window|.
  60. +     The height may be changed anyway when running out of room.
  61.   
  62.                           *'winminheight'* *'wmh'*
  63.   'winminheight' 'wmh'    number    (default 1)
  64. *** ../vim61.194/runtime/optwin.vim    Sun Jun 23 12:49:34 2002
  65. --- runtime/optwin.vim    Sat Jun 22 12:09:51 2002
  66. ***************
  67. *** 389,394 ****
  68. --- 389,397 ----
  69.   call append("$", " \tset wh=" . &wh)
  70.   call append("$", "winminheight\tminimal number of lines used for any window")
  71.   call append("$", " \tset wmh=" . &wmh)
  72. + call append("$", "winfixheight\tkeep the height of the window")
  73. + call append("$", "\t(local to window)")
  74. + call <SID>BinOptionL("wfh")
  75.   if has("vertsplit")
  76.     call append("$", "winwidth\tminimal number of columns used for the current window")
  77.     call append("$", " \tset wiw=" . &wiw)
  78. *** ../vim61.194/src/ex_cmds.c    Sat Sep  7 17:16:30 2002
  79. --- src/ex_cmds.c    Sat Sep  7 17:11:47 2002
  80. ***************
  81. *** 4365,4370 ****
  82. --- 4365,4371 ----
  83.                                         == FAIL)
  84.           return;
  85.           curwin->w_p_pvw = TRUE;
  86. +         curwin->w_p_wfh = TRUE;
  87.       }
  88.       }
  89.   }
  90. *** ../vim61.194/src/ex_getln.c    Mon Sep 16 22:00:32 2002
  91. --- src/ex_getln.c    Sat Sep  7 14:58:21 2002
  92. ***************
  93. *** 366,373 ****
  94.           }
  95.           else if (save_p_ls != -1)
  96.           {
  97. !             /* restore 'laststatus' if it was changed */
  98.               p_ls = save_p_ls;
  99.               last_status(FALSE);
  100.               update_screen(VALID);    /* redraw the screen NOW */
  101.               redrawcmd();
  102. --- 366,374 ----
  103.           }
  104.           else if (save_p_ls != -1)
  105.           {
  106. !             /* restore 'laststatus' and 'winminheight' */
  107.               p_ls = save_p_ls;
  108. +             p_wmh = save_p_wmh;
  109.               last_status(FALSE);
  110.               update_screen(VALID);    /* redraw the screen NOW */
  111.               redrawcmd();
  112. *** ../vim61.194/src/globals.h    Sat May  4 22:23:07 2002
  113. --- src/globals.h    Sun May 12 17:01:21 2002
  114. ***************
  115. *** 821,826 ****
  116. --- 821,827 ----
  117.   
  118.   #ifdef FEAT_WILDMENU
  119.   EXTERN int  save_p_ls INIT(= -1);    /* Save 'laststatus' setting */
  120. + EXTERN int  save_p_wmh INIT(= -1);    /* Save 'winminheight' setting */
  121.   EXTERN int  wild_menu_showing INIT(= 0);
  122.   #define WM_SHOWN    1        /* wildmenu showing */
  123.   #define WM_SCROLLED    2        /* wildmenu showing with scroll */
  124. *** ../vim61.194/src/option.c    Thu Aug 22 20:34:03 2002
  125. --- src/option.c    Fri Sep 20 21:56:21 2002
  126. ***************
  127. *** 121,126 ****
  128. --- 121,127 ----
  129.       , PV_TSR
  130.       , PV_TW
  131.       , PV_TX
  132. +     , PV_WFH
  133.       , PV_WM
  134.       , PV_WRAP
  135.   } idopt_T;
  136. ***************
  137. *** 2150,2155 ****
  138. --- 2153,2165 ----
  139.                   (char_u *)NULL, PV_NONE,
  140.   #endif
  141.                   {(char_u *)1L, (char_u *)0L}},
  142. +     {"winfixheight", "wfh", P_BOOL|P_VI_DEF|P_RSTAT,
  143. + #if defined(FEAT_WINDOWS)
  144. +                 (char_u *)VAR_WIN, PV_WFH,
  145. + #else
  146. +                 (char_u *)NULL, PV_NONE,
  147. + #endif
  148. +                 {(char_u *)FALSE, (char_u *)0L}},
  149.       {"winminheight", "wmh", P_NUM|P_VI_DEF,
  150.   #ifdef FEAT_WINDOWS
  151.                   (char_u *)&p_wmh, PV_NONE,
  152. ***************
  153. *** 7198,7203 ****
  154. --- 7208,7216 ----
  155.       case PV_FMR:    return (char_u *)&(curwin->w_p_fmr);
  156.   #endif
  157.       case PV_NU:    return (char_u *)&(curwin->w_p_nu);
  158. + #if defined(FEAT_WINDOWS)
  159. +     case PV_WFH:    return (char_u *)&(curwin->w_p_wfh);
  160. + #endif
  161.   #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
  162.       case PV_PVW:    return (char_u *)&(curwin->w_p_pvw);
  163.   #endif
  164. *** ../vim61.194/src/quickfix.c    Tue Apr 23 22:43:00 2002
  165. --- src/quickfix.c    Sun May 12 15:33:48 2002
  166. ***************
  167. *** 1592,1597 ****
  168. --- 1592,1598 ----
  169.       /* Only set the height when there is no window to the side. */
  170.       if (curwin->w_width == Columns)
  171.           win_setheight(height);
  172. +     curwin->w_p_wfh = TRUE;        /* set 'winfixheight' */
  173.       }
  174.   
  175.       /*
  176. *** ../vim61.194/src/screen.c    Mon Sep 16 21:17:43 2002
  177. --- src/screen.c    Sat Sep 14 22:02:25 2002
  178. ***************
  179. *** 4679,4689 ****
  180.           }
  181.           else
  182.           {
  183. !         /* create status line if needed */
  184.           if (lastwin->w_status_height == 0)
  185.           {
  186.               save_p_ls = p_ls;
  187.               p_ls = 2;
  188.               last_status(FALSE);
  189.           }
  190.           wild_menu_showing = WM_SHOWN;
  191. --- 4679,4693 ----
  192.           }
  193.           else
  194.           {
  195. !         /* Create status line if needed by setting 'laststatus' to 2.
  196. !          * Set 'winminheight' to zero to avoid that the window is
  197. !          * resized. */
  198.           if (lastwin->w_status_height == 0)
  199.           {
  200.               save_p_ls = p_ls;
  201. +             save_p_wmh = p_wmh;
  202.               p_ls = 2;
  203. +             p_wmh = 0;
  204.               last_status(FALSE);
  205.           }
  206.           wild_menu_showing = WM_SHOWN;
  207. *** ../vim61.194/src/structs.h    Sun Aug 18 16:05:35 2002
  208. --- src/structs.h    Sat Aug  3 21:13:33 2002
  209. ***************
  210. *** 156,161 ****
  211. --- 156,165 ----
  212.   #define w_p_list w_onebuf_opt.wo_list    /* 'list' */
  213.       int        wo_nu;
  214.   #define w_p_nu w_onebuf_opt.wo_nu    /* 'number' */
  215. + #if defined(FEAT_WINDOWS)
  216. +     int        wo_wfh;
  217. + # define w_p_wfh w_onebuf_opt.wo_wfh    /* 'winfixheight' */
  218. + #endif
  219.   #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
  220.       int        wo_pvw;
  221.   # define w_p_pvw w_onebuf_opt.wo_pvw    /* 'previewwindow' */
  222. ***************
  223. *** 1129,1134 ****
  224. --- 1135,1141 ----
  225.       int        fr_width;
  226.   #endif
  227.       int        fr_height;
  228. +     int        fr_newheight;    /* new height used in win_equal_rec() */
  229.       frame_T    *fr_parent;    /* containing frame or NULL */
  230.       frame_T    *fr_next;    /* frame right or below in same parent, NULL
  231.                      for first */
  232. *** ../vim61.194/src/window.c    Sun Jul 21 21:47:39 2002
  233. --- src/window.c    Mon Jun 24 21:34:44 2002
  234. ***************
  235. *** 30,36 ****
  236.   static frame_T *win_altframe __ARGS((win_T *win));
  237.   static win_T *frame2win __ARGS((frame_T *frp));
  238.   static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
  239. ! static void frame_new_height __ARGS((frame_T *topfrp, int height, int topfirst));
  240.   #ifdef FEAT_VERTSPLIT
  241.   static void frame_add_statusline __ARGS((frame_T *frp));
  242.   static void frame_new_width __ARGS((frame_T *topfrp, int width, int leftfirst));
  243. --- 30,37 ----
  244.   static frame_T *win_altframe __ARGS((win_T *win));
  245.   static win_T *frame2win __ARGS((frame_T *frp));
  246.   static int frame_has_win __ARGS((frame_T *frp, win_T *wp));
  247. ! static void frame_new_height __ARGS((frame_T *topfrp, int height, int topfirst, int wfh));
  248. ! static int frame_fixed_height __ARGS((frame_T *frp));
  249.   #ifdef FEAT_VERTSPLIT
  250.   static void frame_add_statusline __ARGS((frame_T *frp));
  251.   static void frame_new_width __ARGS((frame_T *topfrp, int width, int leftfirst));
  252. ***************
  253. *** 717,734 ****
  254.       /* if it doesn't fit in the current window, need win_equal() */
  255.       if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
  256.           do_equal = TRUE;
  257. ! #ifdef FEAT_QUICKFIX
  258. !     /* We don't like to take lines for the new window from a quickfix
  259. !      * or preview window.  Take them from a window above or below
  260.        * instead, if possible. */
  261. !     if (bt_quickfix(oldwin->w_buffer) || oldwin->w_p_pvw)
  262.       {
  263. !         win_setheight_win(oldwin->w_height + new_size, oldwin);
  264.           oldwin_height = oldwin->w_height;
  265.           if (need_status)
  266.           oldwin_height -= STATUS_HEIGHT;
  267.       }
  268. - #endif
  269.       }
  270.   
  271.       /*
  272. --- 718,735 ----
  273.       /* if it doesn't fit in the current window, need win_equal() */
  274.       if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
  275.           do_equal = TRUE;
  276. !     /* We don't like to take lines for the new window from a
  277. !      * 'winfixheight' window.  Take them from a window above or below
  278.        * instead, if possible. */
  279. !     if (oldwin->w_p_wfh)
  280.       {
  281. !         win_setheight_win(oldwin->w_height + new_size + STATUS_HEIGHT,
  282. !                                       oldwin);
  283.           oldwin_height = oldwin->w_height;
  284.           if (need_status)
  285.           oldwin_height -= STATUS_HEIGHT;
  286.       }
  287.       }
  288.   
  289.       /*
  290. ***************
  291. *** 964,970 ****
  292.       win_new_height(wp, new_size);
  293.       if (flags & (WSP_TOP | WSP_BOT))
  294.           frame_new_height(curfrp, curfrp->fr_height
  295. !                    - (new_size + STATUS_HEIGHT), flags & WSP_TOP);
  296.       else
  297.           win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
  298.       if (before)    /* new window above current one */
  299. --- 965,971 ----
  300.       win_new_height(wp, new_size);
  301.       if (flags & (WSP_TOP | WSP_BOT))
  302.           frame_new_height(curfrp, curfrp->fr_height
  303. !             - (new_size + STATUS_HEIGHT), flags & WSP_TOP, FALSE);
  304.       else
  305.           win_new_height(oldwin, oldwin_height - (new_size + STATUS_HEIGHT));
  306.       if (before)    /* new window above current one */
  307. ***************
  308. *** 1402,1407 ****
  309. --- 1403,1409 ----
  310.       int        flags;
  311.   {
  312.       int        dir;
  313. +     int        height = curwin->w_height;
  314.   
  315.       if (lastwin == firstwin)
  316.       {
  317. ***************
  318. *** 1412,1421 ****
  319.       /* Remove the window and frame from the tree of frames. */
  320.       (void)winframe_remove(curwin, &dir);
  321.       win_remove(curwin);
  322. !     (void)win_comp_pos();
  323.   
  324.       /* Split a window on the right side and put the window there. */
  325.       (void)win_split_ins(size, flags, curwin, dir);
  326.   
  327.   #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
  328.       /* When 'guioptions' includes 'L' or 'R' may have to remove or add
  329. --- 1414,1425 ----
  330.       /* Remove the window and frame from the tree of frames. */
  331.       (void)winframe_remove(curwin, &dir);
  332.       win_remove(curwin);
  333. !     last_status(FALSE);        /* may need to remove last status line */
  334. !     (void)win_comp_pos();   /* recompute window positions */
  335.   
  336.       /* Split a window on the right side and put the window there. */
  337.       (void)win_split_ins(size, flags, curwin, dir);
  338. +     win_setheight(height);
  339.   
  340.   #if defined(FEAT_GUI) && defined(FEAT_VERTSPLIT)
  341.       /* When 'guioptions' includes 'L' or 'R' may have to remove or add
  342. ***************
  343. *** 1526,1535 ****
  344.       int        next_curwin_size = 0;
  345.       int        room = 0;
  346.       int        new_size;
  347. - #ifdef FEAT_QUICKFIX
  348. -     int        quickfix_height = 0;
  349. -     int        preview_height = 0;
  350. - #endif
  351.       int        has_next_curwin = 0;
  352.       int        hnc;
  353.   
  354. --- 1530,1535 ----
  355. ***************
  356. *** 1544,1550 ****
  357.          )
  358.       {
  359.           topfr->fr_win->w_winrow = row;
  360. !         frame_new_height(topfr, height, FALSE);
  361.   #ifdef FEAT_VERTSPLIT
  362.           topfr->fr_win->w_wincol = col;
  363.           frame_new_width(topfr, width, FALSE);
  364. --- 1544,1550 ----
  365.          )
  366.       {
  367.           topfr->fr_win->w_winrow = row;
  368. !         frame_new_height(topfr, height, FALSE, FALSE);
  369.   #ifdef FEAT_VERTSPLIT
  370.           topfr->fr_win->w_wincol = col;
  371.           frame_new_width(topfr, width, FALSE);
  372. ***************
  373. *** 1672,1690 ****
  374.           }
  375.           else
  376.           {
  377. - #ifdef FEAT_QUICKFIX
  378.           next_curwin_size = -1;
  379.           for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
  380.           {
  381. !             /* The quickfix and preview window keep their height if
  382.                * possible.
  383.                * Watch out for this window being the next_curwin. */
  384. !             if (fr->fr_win != NULL
  385. !                 && (bt_quickfix(fr->fr_win->w_buffer)
  386. !                 || fr->fr_win->w_p_pvw))
  387.               {
  388.               new_size = fr->fr_height;
  389. !             if (fr->fr_win == next_curwin)
  390.               {
  391.                   room += p_wh - p_wmh;
  392.                   next_curwin_size = 0;
  393. --- 1672,1688 ----
  394.           }
  395.           else
  396.           {
  397.           next_curwin_size = -1;
  398.           for (fr = topfr->fr_child; fr != NULL; fr = fr->fr_next)
  399.           {
  400. !             /* If 'winfixheight' set keep the window height if
  401.                * possible.
  402.                * Watch out for this window being the next_curwin. */
  403. !             if (frame_fixed_height(fr))
  404.               {
  405. +             n = frame_minheight(fr, NOWIN);
  406.               new_size = fr->fr_height;
  407. !             if (frame_has_win(fr, next_curwin))
  408.               {
  409.                   room += p_wh - p_wmh;
  410.                   next_curwin_size = 0;
  411. ***************
  412. *** 1692,1712 ****
  413.                   new_size = p_wh;
  414.               }
  415.               else
  416. !                 --totwincount;
  417. !             room -= new_size - p_wmh - fr->fr_win->w_status_height;
  418.               if (room < 0)
  419.               {
  420.                   new_size += room;
  421.                   room = 0;
  422.               }
  423. !             if (fr->fr_win->w_p_pvw)
  424. !                 preview_height = new_size;
  425. !             else
  426. !                 quickfix_height = new_size;
  427.               }
  428.           }
  429.           if (next_curwin_size == -1)
  430. - #endif
  431.           {
  432.               if (!has_next_curwin)
  433.               next_curwin_size = 0;
  434. --- 1690,1708 ----
  435.                   new_size = p_wh;
  436.               }
  437.               else
  438. !                 /* These windows don't use up room. */
  439. !                 totwincount -= (n + (fr->fr_next == NULL
  440. !                           ? extra_sep : 0)) / (p_wmh + 1);
  441. !             room -= new_size - n;
  442.               if (room < 0)
  443.               {
  444.                   new_size += room;
  445.                   room = 0;
  446.               }
  447. !             fr->fr_newheight = new_size;
  448.               }
  449.           }
  450.           if (next_curwin_size == -1)
  451.           {
  452.               if (!has_next_curwin)
  453.               next_curwin_size = 0;
  454. ***************
  455. *** 1736,1753 ****
  456.           new_size = height;
  457.           else if (dir == 'h')
  458.           new_size = fr->fr_height;
  459. ! #ifdef FEAT_QUICKFIX
  460. !         else if (fr->fr_win != NULL && bt_quickfix(fr->fr_win->w_buffer))
  461. !         {
  462. !         new_size = quickfix_height;
  463. !         wincount = 0;        /* doesn't count as a sizeable window */
  464. !         }
  465. !         else if (fr->fr_win != NULL && fr->fr_win->w_p_pvw)
  466.           {
  467. !         new_size = preview_height;
  468.           wincount = 0;        /* doesn't count as a sizeable window */
  469.           }
  470. - #endif
  471.           else
  472.           {
  473.           /* Compute the maximum number of windows vert. in "fr". */
  474. --- 1732,1742 ----
  475.           new_size = height;
  476.           else if (dir == 'h')
  477.           new_size = fr->fr_height;
  478. !         else if (frame_fixed_height(fr))
  479.           {
  480. !         new_size = fr->fr_newheight;
  481.           wincount = 0;        /* doesn't count as a sizeable window */
  482.           }
  483.           else
  484.           {
  485.           /* Compute the maximum number of windows vert. in "fr". */
  486. ***************
  487. *** 1974,1979 ****
  488. --- 1963,1969 ----
  489.       frame_T    *frp, *frp2, *frp3;
  490.       frame_T    *frp_close = win->w_frame;
  491.       win_T    *wp;
  492. +     int        old_height = 0;
  493.   
  494.       /*
  495.        * Remove the window from its frame.
  496. ***************
  497. *** 1998,2022 ****
  498.       if (frp_close->fr_parent->fr_layout == FR_COL)
  499.       {
  500.   #endif
  501. ! #ifdef FEAT_QUICKFIX
  502. !     int    old_height = 0;
  503. !     /* For a preview or quickfix window, remember its old size and restore
  504.        * it later (it's a simplistic solution...).  Don't do this if the
  505.        * window will occupy the full height of the screen. */
  506.       if (frp2->fr_win != NULL
  507. !         && (frp2->fr_next != NULL
  508. !             || frp2->fr_prev != NULL)
  509. !         && (frp2->fr_win->w_p_pvw
  510. !             || bt_quickfix(frp2->fr_win->w_buffer)))
  511.           old_height = frp2->fr_win->w_height;
  512. - #endif
  513.       frame_new_height(frp2, frp2->fr_height + frp_close->fr_height,
  514. !                    frp2 == frp_close->fr_next ? TRUE : FALSE);
  515. ! #ifdef FEAT_QUICKFIX
  516.       if (old_height != 0)
  517.           win_setheight_win(old_height, frp2->fr_win);
  518. - #endif
  519.   #ifdef FEAT_VERTSPLIT
  520.       *dirp = 'v';
  521.       }
  522. --- 1988,2004 ----
  523.       if (frp_close->fr_parent->fr_layout == FR_COL)
  524.       {
  525.   #endif
  526. !     /* When 'winfixheight' is set, remember its old size and restore
  527.        * it later (it's a simplistic solution...).  Don't do this if the
  528.        * window will occupy the full height of the screen. */
  529.       if (frp2->fr_win != NULL
  530. !         && (frp2->fr_next != NULL || frp2->fr_prev != NULL)
  531. !         && frp2->fr_win->w_p_wfh)
  532.           old_height = frp2->fr_win->w_height;
  533.       frame_new_height(frp2, frp2->fr_height + frp_close->fr_height,
  534. !                 frp2 == frp_close->fr_next ? TRUE : FALSE, FALSE);
  535.       if (old_height != 0)
  536.           win_setheight_win(old_height, frp2->fr_win);
  537.   #ifdef FEAT_VERTSPLIT
  538.       *dirp = 'v';
  539.       }
  540. ***************
  541. *** 2133,2142 ****
  542.    * frames and windows.  Caller must take care of positions.
  543.    */
  544.       static void
  545. ! frame_new_height(topfrp, height, topfirst)
  546.       frame_T    *topfrp;
  547.       int        height;
  548.       int        topfirst;    /* resize topmost contained frame first */
  549.   {
  550.       frame_T    *frp;
  551.       int        extra_lines;
  552. --- 2115,2126 ----
  553.    * frames and windows.  Caller must take care of positions.
  554.    */
  555.       static void
  556. ! frame_new_height(topfrp, height, topfirst, wfh)
  557.       frame_T    *topfrp;
  558.       int        height;
  559.       int        topfirst;    /* resize topmost contained frame first */
  560. +     int        wfh;        /* obey 'winfixheight' when there is a choice;
  561. +                    may cause the height not to be set */
  562.   {
  563.       frame_T    *frp;
  564.       int        extra_lines;
  565. ***************
  566. *** 2153,2159 ****
  567.       {
  568.       /* All frames in this row get the same new height. */
  569.       for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
  570. !         frame_new_height(frp, height, topfirst);
  571.       }
  572.   #endif
  573.       else
  574. --- 2137,2143 ----
  575.       {
  576.       /* All frames in this row get the same new height. */
  577.       for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
  578. !         frame_new_height(frp, height, topfirst, wfh);
  579.       }
  580.   #endif
  581.       else
  582. ***************
  583. *** 2162,2205 ****
  584.        * frame first, frames above that when needed. */
  585.   
  586.       frp = topfrp->fr_child;
  587.       if (!topfirst)
  588.           /* Find the bottom frame of this column */
  589.           while (frp->fr_next != NULL)
  590.           frp = frp->fr_next;
  591.   
  592.       extra_lines = height - topfrp->fr_height;
  593.       if (extra_lines < 0)
  594.       {
  595. !         /* reduce frame height, bottom frame first */
  596.           while (frp != NULL)
  597.           {
  598.           h = frame_minheight(frp, NULL);
  599.           if (frp->fr_height + extra_lines < h)
  600.           {
  601.               extra_lines += frp->fr_height - h;
  602. !             frame_new_height(frp, h, topfirst);
  603.           }
  604.           else
  605.           {
  606.               frame_new_height(frp, frp->fr_height + extra_lines,
  607. !                                     topfirst);
  608.               break;
  609.           }
  610.           if (topfirst)
  611. !             frp = frp->fr_next;
  612.           else
  613. !             frp = frp->fr_prev;
  614.           }
  615.       }
  616.       else if (extra_lines > 0)
  617.       {
  618.           /* increase height of bottom or top frame */
  619. !         frame_new_height(frp, frp->fr_height + extra_lines, topfirst);
  620.       }
  621.       }
  622.       topfrp->fr_height = height;
  623.   }
  624.   
  625.   #ifdef FEAT_VERTSPLIT
  626.   /*
  627.    * Add a status line to windows at the bottom of "frp".
  628. --- 2146,2244 ----
  629.        * frame first, frames above that when needed. */
  630.   
  631.       frp = topfrp->fr_child;
  632. +     if (wfh)
  633. +         /* Advance past frames with one window with 'wfh' set. */
  634. +         while (frame_fixed_height(frp))
  635. +         {
  636. +         frp = frp->fr_next;
  637. +         if (frp == NULL)
  638. +             return;        /* no frame without 'wfh', give up */
  639. +         }
  640.       if (!topfirst)
  641. +     {
  642.           /* Find the bottom frame of this column */
  643.           while (frp->fr_next != NULL)
  644.           frp = frp->fr_next;
  645. +         if (wfh)
  646. +         /* Advance back for frames with one window with 'wfh' set. */
  647. +         while (frame_fixed_height(frp))
  648. +             frp = frp->fr_prev;
  649. +     }
  650.   
  651.       extra_lines = height - topfrp->fr_height;
  652.       if (extra_lines < 0)
  653.       {
  654. !         /* reduce height of contained frames, bottom or top frame first */
  655.           while (frp != NULL)
  656.           {
  657.           h = frame_minheight(frp, NULL);
  658.           if (frp->fr_height + extra_lines < h)
  659.           {
  660.               extra_lines += frp->fr_height - h;
  661. !             frame_new_height(frp, h, topfirst, wfh);
  662.           }
  663.           else
  664.           {
  665.               frame_new_height(frp, frp->fr_height + extra_lines,
  666. !                                    topfirst, wfh);
  667.               break;
  668.           }
  669.           if (topfirst)
  670. !         {
  671. !             do
  672. !             frp = frp->fr_next;
  673. !             while (wfh && frp != NULL && frame_fixed_height(frp));
  674. !         }
  675.           else
  676. !         {
  677. !             do
  678. !             frp = frp->fr_prev;
  679. !             while (wfh && frp != NULL && frame_fixed_height(frp));
  680. !         }
  681. !         /* Increase "height" if we could not reduce enough frames. */
  682. !         if (frp == NULL)
  683. !             height -= extra_lines;
  684.           }
  685.       }
  686.       else if (extra_lines > 0)
  687.       {
  688.           /* increase height of bottom or top frame */
  689. !         frame_new_height(frp, frp->fr_height + extra_lines, topfirst, wfh);
  690.       }
  691.       }
  692.       topfrp->fr_height = height;
  693.   }
  694.   
  695. + /*
  696. +  * Return TRUE if height of frame "frp" should not be changed because of
  697. +  * the 'winfixheight' option.
  698. +  */
  699. +     static int
  700. + frame_fixed_height(frp)
  701. +     frame_T    *frp;
  702. + {
  703. +     /* frame with one window: fixed height if 'winfixheight' set. */
  704. +     if (frp->fr_win != NULL)
  705. +     return frp->fr_win->w_p_wfh;
  706. +     if (frp->fr_layout == FR_ROW)
  707. +     {
  708. +     /* The frame is fixed height if one of the frames in the row is fixed
  709. +      * height. */
  710. +     for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
  711. +         if (frame_fixed_height(frp))
  712. +         return TRUE;
  713. +     return FALSE;
  714. +     }
  715. +     /* frp->fr_layout == FR_COL: The frame is fixed height if all of the
  716. +      * frames in the row are fixed height. */
  717. +     for (frp = frp->fr_child; frp != NULL; frp = frp->fr_next)
  718. +     if (!frame_fixed_height(frp))
  719. +         return FALSE;
  720. +     return TRUE;
  721. + }
  722.   #ifdef FEAT_VERTSPLIT
  723.   /*
  724.    * Add a status line to windows at the bottom of "frp".
  725. ***************
  726. *** 2904,2910 ****
  727.       redraw_later(VALID);    /* causes status line redraw */
  728.   
  729.       /* set window height to desired minimal value */
  730. !     if (curwin->w_height < p_wh)
  731.       win_setheight((int)p_wh);
  732.   
  733.   #ifdef FEAT_VERTSPLIT
  734. --- 2943,2949 ----
  735.       redraw_later(VALID);    /* causes status line redraw */
  736.   
  737.       /* set window height to desired minimal value */
  738. !     if (curwin->w_height < p_wh && !curwin->w_p_wfh)
  739.       win_setheight((int)p_wh);
  740.   
  741.   #ifdef FEAT_VERTSPLIT
  742. ***************
  743. *** 3204,3210 ****
  744.   #ifdef FEAT_WINDOWS
  745.       if (h < frame_minheight(topframe, NULL))
  746.       h = frame_minheight(topframe, NULL);
  747. !     frame_new_height(topframe, h, FALSE);
  748.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  749.   #else
  750.       if (h < 1)
  751. --- 3243,3254 ----
  752.   #ifdef FEAT_WINDOWS
  753.       if (h < frame_minheight(topframe, NULL))
  754.       h = frame_minheight(topframe, NULL);
  755. !     /* First try setting the heights of windows without 'winfixheight'.  If
  756. !      * that doesn't result in the right height, forget about that option. */
  757. !     frame_new_height(topframe, h, FALSE, TRUE);
  758. !     if (topframe->fr_height != h)
  759. !     frame_new_height(topframe, h, FALSE, FALSE);
  760.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  761.   #else
  762.       if (h < 1)
  763. ***************
  764. *** 3443,3451 ****
  765.       int        run;
  766.       frame_T    *frp;
  767.       int        h;
  768. - #ifdef FEAT_QUICKFIX
  769.       int        room_reserved;
  770. - #endif
  771.   
  772.       /* If the height already is the desired value, nothing to do. */
  773.       if (curfrp->fr_height == height)
  774. --- 3487,3493 ----
  775. ***************
  776. *** 3457,3463 ****
  777.       if (height > Rows - p_ch)
  778.           height = Rows - p_ch;
  779.       if (height > 0)
  780. !         frame_new_height(curfrp, height, FALSE);
  781.       }
  782.       else if (curfrp->fr_parent->fr_layout == FR_ROW)
  783.       {
  784. --- 3499,3505 ----
  785.       if (height > Rows - p_ch)
  786.           height = Rows - p_ch;
  787.       if (height > 0)
  788. !         frame_new_height(curfrp, height, FALSE, FALSE);
  789.       }
  790.       else if (curfrp->fr_parent->fr_layout == FR_ROW)
  791.       {
  792. ***************
  793. *** 3479,3485 ****
  794.        * 1: compute room available, if it's not enough try resizing the
  795.        *    containing frame.
  796.        * 2: compute the room available and adjust the height to it.
  797. !      * Try not to reduce the height of the quickfix and preview window.
  798.        */
  799.       for (run = 1; run <= 2; ++run)
  800.   #else
  801. --- 3521,3527 ----
  802.        * 1: compute room available, if it's not enough try resizing the
  803.        *    containing frame.
  804.        * 2: compute the room available and adjust the height to it.
  805. !      * Try not to reduce the height of a window with 'winfixheight' set.
  806.        */
  807.       for (run = 1; run <= 2; ++run)
  808.   #else
  809. ***************
  810. *** 3487,3505 ****
  811.   #endif
  812.       {
  813.           room = 0;
  814. - #ifdef FEAT_QUICKFIX
  815.           room_reserved = 0;
  816. - #endif
  817.           for (frp = curfrp->fr_parent->fr_child; frp != NULL;
  818.                                  frp = frp->fr_next)
  819.           {
  820. - #ifdef FEAT_QUICKFIX
  821.           if (frp != curfrp
  822.               && frp->fr_win != NULL
  823. !             && (frp->fr_win->w_p_pvw
  824. !                 || bt_quickfix(frp->fr_win->w_buffer)))
  825.               room_reserved += frp->fr_height;
  826. - #endif
  827.           room += frp->fr_height;
  828.           if (frp != curfrp)
  829.               room -= frame_minheight(frp, NULL);
  830. --- 3529,3542 ----
  831.   #endif
  832.       {
  833.           room = 0;
  834.           room_reserved = 0;
  835.           for (frp = curfrp->fr_parent->fr_child; frp != NULL;
  836.                                  frp = frp->fr_next)
  837.           {
  838.           if (frp != curfrp
  839.               && frp->fr_win != NULL
  840. !             && frp->fr_win->w_p_wfh)
  841.               room_reserved += frp->fr_height;
  842.           room += frp->fr_height;
  843.           if (frp != curfrp)
  844.               room -= frame_minheight(frp, NULL);
  845. ***************
  846. *** 3539,3554 ****
  847.        */
  848.       take = height - curfrp->fr_height;
  849.   
  850. ! #ifdef FEAT_QUICKFIX
  851. !     /* If there is not enough room, also reduce the height of quickfix and
  852. !      * preview window. */
  853.       if (height > room + room_cmdline - room_reserved)
  854.           room_reserved = room + room_cmdline - height;
  855. !     /* If there is only a quickfix or preview window and making the
  856.        * window smaller, need to make the other window taller. */
  857.       if (take < 0 && room - curfrp->fr_height < room_reserved)
  858.           room_reserved = 0;
  859. - #endif
  860.   
  861.       if (take > 0 && room_cmdline > 0)
  862.       {
  863. --- 3576,3589 ----
  864.        */
  865.       take = height - curfrp->fr_height;
  866.   
  867. !     /* If there is not enough room, also reduce the height of a window
  868. !      * with 'winfixheight' set. */
  869.       if (height > room + room_cmdline - room_reserved)
  870.           room_reserved = room + room_cmdline - height;
  871. !     /* If there is only a 'winfixheight' window and making the
  872.        * window smaller, need to make the other window taller. */
  873.       if (take < 0 && room - curfrp->fr_height < room_reserved)
  874.           room_reserved = 0;
  875.   
  876.       if (take > 0 && room_cmdline > 0)
  877.       {
  878. ***************
  879. *** 3562,3568 ****
  880.       /*
  881.        * set the current frame to the new height
  882.        */
  883. !     frame_new_height(curfrp, height, FALSE);
  884.   
  885.       /*
  886.        * First take lines from the frames after the current frame.  If
  887. --- 3597,3603 ----
  888.       /*
  889.        * set the current frame to the new height
  890.        */
  891. !     frame_new_height(curfrp, height, FALSE, FALSE);
  892.   
  893.       /*
  894.        * First take lines from the frames after the current frame.  If
  895. ***************
  896. *** 3578,3588 ****
  897.           while (frp != NULL && take != 0)
  898.           {
  899.           h = frame_minheight(frp, NULL);
  900. - #ifdef FEAT_QUICKFIX
  901.           if (room_reserved > 0
  902.               && frp->fr_win != NULL
  903. !             && (frp->fr_win->w_p_pvw
  904. !                 || bt_quickfix(frp->fr_win->w_buffer)))
  905.           {
  906.               if (room_reserved >= frp->fr_height)
  907.               room_reserved -= frp->fr_height;
  908. --- 3613,3621 ----
  909.           while (frp != NULL && take != 0)
  910.           {
  911.           h = frame_minheight(frp, NULL);
  912.           if (room_reserved > 0
  913.               && frp->fr_win != NULL
  914. !             && frp->fr_win->w_p_wfh)
  915.           {
  916.               if (room_reserved >= frp->fr_height)
  917.               room_reserved -= frp->fr_height;
  918. ***************
  919. *** 3591,3611 ****
  920.               if (frp->fr_height - room_reserved > take)
  921.                   room_reserved = frp->fr_height - take;
  922.               take -= frp->fr_height - room_reserved;
  923. !             frame_new_height(frp, room_reserved, FALSE);
  924.               room_reserved = 0;
  925.               }
  926.           }
  927.           else
  928. - #endif
  929.           {
  930.               if (frp->fr_height - take < h)
  931.               {
  932.               take -= frp->fr_height - h;
  933. !             frame_new_height(frp, h, FALSE);
  934.               }
  935.               else
  936.               {
  937. !             frame_new_height(frp, frp->fr_height - take, FALSE);
  938.               take = 0;
  939.               }
  940.           }
  941. --- 3624,3644 ----
  942.               if (frp->fr_height - room_reserved > take)
  943.                   room_reserved = frp->fr_height - take;
  944.               take -= frp->fr_height - room_reserved;
  945. !             frame_new_height(frp, room_reserved, FALSE, FALSE);
  946.               room_reserved = 0;
  947.               }
  948.           }
  949.           else
  950.           {
  951.               if (frp->fr_height - take < h)
  952.               {
  953.               take -= frp->fr_height - h;
  954. !             frame_new_height(frp, h, FALSE, FALSE);
  955.               }
  956.               else
  957.               {
  958. !             frame_new_height(frp, frp->fr_height - take,
  959. !                                 FALSE, FALSE);
  960.               take = 0;
  961.               }
  962.           }
  963. ***************
  964. *** 3877,3883 ****
  965.        * Doesn't happen when dragging the last status line up.
  966.        */
  967.       if (fr != NULL)
  968. !     frame_new_height(fr, fr->fr_height + offset, up);
  969.   
  970.       if (up)
  971.       fr = curfr;        /* current frame gets smaller */
  972. --- 3910,3916 ----
  973.        * Doesn't happen when dragging the last status line up.
  974.        */
  975.       if (fr != NULL)
  976. !     frame_new_height(fr, fr->fr_height + offset, up, FALSE);
  977.   
  978.       if (up)
  979.       fr = curfr;        /* current frame gets smaller */
  980. ***************
  981. *** 3893,3903 ****
  982.       if (fr->fr_height - offset <= n)
  983.       {
  984.           offset -= fr->fr_height - n;
  985. !         frame_new_height(fr, n, !up);
  986.       }
  987.       else
  988.       {
  989. !         frame_new_height(fr, fr->fr_height - offset, !up);
  990.           break;
  991.       }
  992.       if (up)
  993. --- 3926,3936 ----
  994.       if (fr->fr_height - offset <= n)
  995.       {
  996.           offset -= fr->fr_height - n;
  997. !         frame_new_height(fr, n, !up, FALSE);
  998.       }
  999.       else
  1000.       {
  1001. !         frame_new_height(fr, fr->fr_height - offset, !up, FALSE);
  1002.           break;
  1003.       }
  1004.       if (up)
  1005. ***************
  1006. *** 4174,4183 ****
  1007.   
  1008.       /* Find bottom frame with width of screen. */
  1009.       frp = lastwin->w_frame;
  1010. ! #ifdef FEAT_VERTSPLIT
  1011.       while (frp->fr_width != Columns && frp->fr_parent != NULL)
  1012.       frp = frp->fr_parent;
  1013. ! #endif
  1014.   
  1015.       if (starting != NO_SCREEN)
  1016.       {
  1017. --- 4207,4221 ----
  1018.   
  1019.       /* Find bottom frame with width of screen. */
  1020.       frp = lastwin->w_frame;
  1021. ! # ifdef FEAT_VERTSPLIT
  1022.       while (frp->fr_width != Columns && frp->fr_parent != NULL)
  1023.       frp = frp->fr_parent;
  1024. ! # endif
  1025. !     /* Avoid changing the height of a window with 'winfixheight' set. */
  1026. !     while (frp->fr_prev != NULL && frp->fr_layout == FR_LEAF
  1027. !                               && frp->fr_win->w_p_wfh)
  1028. !     frp = frp->fr_prev;
  1029.   
  1030.       if (starting != NO_SCREEN)
  1031.       {
  1032. ***************
  1033. *** 4219,4224 ****
  1034. --- 4257,4266 ----
  1035.       redraw_cmdline = TRUE;
  1036.       }
  1037.       frame_add_height(frp, (int)(old_p_ch - p_ch));
  1038. +     /* Recompute window positions. */
  1039. +     if (frp != lastwin->w_frame)
  1040. +     (void)win_comp_pos();
  1041.   #else
  1042.       win_setheight((int)(firstwin->w_height + old_p_ch - p_ch));
  1043.       cmdline_row = Rows - p_ch;
  1044. ***************
  1045. *** 4235,4241 ****
  1046.       frame_T    *frp;
  1047.       int        n;
  1048.   {
  1049. !     frame_new_height(frp, frp->fr_height + n, FALSE);
  1050.       for (;;)
  1051.       {
  1052.       frp = frp->fr_parent;
  1053. --- 4277,4283 ----
  1054.       frame_T    *frp;
  1055.       int        n;
  1056.   {
  1057. !     frame_new_height(frp, frp->fr_height + n, FALSE, FALSE);
  1058.       for (;;)
  1059.       {
  1060.       frp = frp->fr_parent;
  1061. ***************
  1062. *** 4297,4303 ****
  1063.           wp->w_status_height = 1;
  1064.           if (fp != fr)
  1065.           {
  1066. !         frame_new_height(fp, fp->fr_height - 1, FALSE);
  1067.           frame_fix_height(wp);
  1068.           (void)win_comp_pos();
  1069.           }
  1070. --- 4339,4345 ----
  1071.           wp->w_status_height = 1;
  1072.           if (fp != fr)
  1073.           {
  1074. !         frame_new_height(fp, fp->fr_height - 1, FALSE, FALSE);
  1075.           frame_fix_height(wp);
  1076.           (void)win_comp_pos();
  1077.           }
  1078. ***************
  1079. *** 4801,4807 ****
  1080.   # endif
  1081.       if (fr->fr_layout == FR_LEAF)
  1082.       {
  1083. !     frame_new_height(fr, fr->fr_height, FALSE);
  1084.   # ifdef FEAT_VERTSPLIT
  1085.       frame_new_width(fr, fr->fr_width, FALSE);
  1086.   # endif
  1087. --- 4843,4849 ----
  1088.   # endif
  1089.       if (fr->fr_layout == FR_LEAF)
  1090.       {
  1091. !     frame_new_height(fr, fr->fr_height, FALSE, FALSE);
  1092.   # ifdef FEAT_VERTSPLIT
  1093.       frame_new_width(fr, fr->fr_width, FALSE);
  1094.   # endif
  1095. *** ../vim61.194/src/version.c    Mon Sep 23 21:19:48 2002
  1096. --- src/version.c    Mon Sep 23 21:24:21 2002
  1097. ***************
  1098. *** 608,609 ****
  1099. --- 608,611 ----
  1100.   {   /* Add new patch number below this line */
  1101. + /**/
  1102. +     195,
  1103.   /**/
  1104.  
  1105. -- 
  1106. Tips for aliens in New York: Land anywhere.  Central Park, anywhere.
  1107. No one will care or indeed even notice.
  1108.         -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
  1109.  
  1110.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  1111. ///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
  1112. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  1113.  \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
  1114.