Loading ...
Sorry, an error occurred while loading the content.

Patch 7.3.1246

Expand Messages
  • Bram Moolenaar
    Patch 7.3.1246 Problem: When setting winfixheight and resizing the window causes the window layout to be wrong. Solution: Add frame_check_height() and
    Message 1 of 1 , Jun 26, 2013
    • 0 Attachment
      Patch 7.3.1246
      Problem: When setting 'winfixheight' and resizing the window causes the
      window layout to be wrong.
      Solution: Add frame_check_height() and frame_check_width() (Yukihiro
      Nakadaira)
      Files: src/window.c


      *** ../vim-7.3.1245/src/window.c 2013-06-16 17:32:33.000000000 +0200
      --- src/window.c 2013-06-26 13:51:25.000000000 +0200
      ***************
      *** 66,71 ****
      --- 66,76 ----
      static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
      static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));

      + static int frame_check_height __ARGS((frame_T *topfrp, int height));
      + #ifdef FEAT_VERTSPLIT
      + static int frame_check_width __ARGS((frame_T *topfrp, int width));
      + #endif
      +
      #endif /* FEAT_WINDOWS */

      static win_T *win_alloc __ARGS((win_T *after, int hidden));
      ***************
      *** 4749,4755 ****
      /* First try setting the heights of windows with '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 */
      --- 4754,4760 ----
      /* First try setting the heights of windows with 'winfixheight'. If
      * that doesn't result in the right height, forget about that option. */
      frame_new_height(topframe, h, FALSE, TRUE);
      ! if (!frame_check_height(topframe, h))
      frame_new_height(topframe, h, FALSE, FALSE);

      (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
      ***************
      *** 4783,4789 ****
      /* First try setting the widths of windows with 'winfixwidth'. If that
      * doesn't result in the right width, forget about that option. */
      frame_new_width(topframe, (int)Columns, FALSE, TRUE);
      ! if (topframe->fr_width != Columns)
      frame_new_width(topframe, (int)Columns, FALSE, FALSE);

      (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
      --- 4788,4794 ----
      /* First try setting the widths of windows with 'winfixwidth'. If that
      * doesn't result in the right width, forget about that option. */
      frame_new_width(topframe, (int)Columns, FALSE, TRUE);
      ! if (!frame_check_width(topframe, Columns))
      frame_new_width(topframe, (int)Columns, FALSE, FALSE);

      (void)win_comp_pos(); /* recompute w_winrow and w_wincol */
      ***************
      *** 6922,6924 ****
      --- 6927,6974 ----
      return i;
      }
      #endif
      +
      + /*
      + * Return TRUE if "topfrp" and its children are at the right height.
      + */
      + static int
      + frame_check_height(topfrp, height)
      + frame_T *topfrp;
      + int height;
      + {
      + frame_T *frp;
      +
      + if (topfrp->fr_height != height)
      + return FALSE;
      +
      + if (topfrp->fr_layout == FR_ROW)
      + for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
      + if (frp->fr_height != height)
      + return FALSE;
      +
      + return TRUE;
      + }
      +
      + #ifdef FEAT_VERTSPLIT
      + /*
      + * Return TRUE if "topfrp" and its children are at the right width.
      + */
      + static int
      + frame_check_width(topfrp, width)
      + frame_T *topfrp;
      + int width;
      + {
      + frame_T *frp;
      +
      + if (topfrp->fr_width != width)
      + return FALSE;
      +
      + if (topfrp->fr_layout == FR_COL)
      + for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
      + if (frp->fr_width != width)
      + return FALSE;
      +
      + return TRUE;
      + }
      + #endif
      +
      *** ../vim-7.3.1245/src/version.c 2013-06-26 13:16:13.000000000 +0200
      --- src/version.c 2013-06-26 13:47:56.000000000 +0200
      ***************
      *** 730,731 ****
      --- 730,733 ----
      { /* Add new patch number below this line */
      + /**/
      + 1246,
      /**/

      --
      Back up my hard drive? I can't find the reverse switch!

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ an exciting new programming language -- http://www.Zimbu.org ///
      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

      --
      --
      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+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.