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 / 7.3 / 7.3.1246 < prev    next >
Encoding:
Internet Message Format  |  2013-06-25  |  4.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.3.1246
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.3.1246
  11. Problem:    When setting 'winfixheight' and resizing the window causes the
  12.         window layout to be wrong.
  13. Solution:   Add frame_check_height() and frame_check_width() (Yukihiro
  14.         Nakadaira)
  15. Files:        src/window.c
  16.  
  17.  
  18. *** ../vim-7.3.1245/src/window.c    2013-06-16 17:32:33.000000000 +0200
  19. --- src/window.c    2013-06-26 13:51:25.000000000 +0200
  20. ***************
  21. *** 66,71 ****
  22. --- 66,76 ----
  23.   static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
  24.   static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr));
  25.   
  26. + static int frame_check_height __ARGS((frame_T *topfrp, int height));
  27. + #ifdef FEAT_VERTSPLIT
  28. + static int frame_check_width __ARGS((frame_T *topfrp, int width));
  29. + #endif
  30.   #endif /* FEAT_WINDOWS */
  31.   
  32.   static win_T *win_alloc __ARGS((win_T *after, int hidden));
  33. ***************
  34. *** 4749,4755 ****
  35.       /* First try setting the heights of windows with 'winfixheight'.  If
  36.        * that doesn't result in the right height, forget about that option. */
  37.       frame_new_height(topframe, h, FALSE, TRUE);
  38. !     if (topframe->fr_height != h)
  39.       frame_new_height(topframe, h, FALSE, FALSE);
  40.   
  41.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  42. --- 4754,4760 ----
  43.       /* First try setting the heights of windows with 'winfixheight'.  If
  44.        * that doesn't result in the right height, forget about that option. */
  45.       frame_new_height(topframe, h, FALSE, TRUE);
  46. !     if (!frame_check_height(topframe, h))
  47.       frame_new_height(topframe, h, FALSE, FALSE);
  48.   
  49.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  50. ***************
  51. *** 4783,4789 ****
  52.       /* First try setting the widths of windows with 'winfixwidth'.  If that
  53.        * doesn't result in the right width, forget about that option. */
  54.       frame_new_width(topframe, (int)Columns, FALSE, TRUE);
  55. !     if (topframe->fr_width != Columns)
  56.       frame_new_width(topframe, (int)Columns, FALSE, FALSE);
  57.   
  58.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  59. --- 4788,4794 ----
  60.       /* First try setting the widths of windows with 'winfixwidth'.  If that
  61.        * doesn't result in the right width, forget about that option. */
  62.       frame_new_width(topframe, (int)Columns, FALSE, TRUE);
  63. !     if (!frame_check_width(topframe, Columns))
  64.       frame_new_width(topframe, (int)Columns, FALSE, FALSE);
  65.   
  66.       (void)win_comp_pos();        /* recompute w_winrow and w_wincol */
  67. ***************
  68. *** 6922,6924 ****
  69. --- 6927,6974 ----
  70.       return i;
  71.   }
  72.   #endif
  73. + /*
  74. +  * Return TRUE if "topfrp" and its children are at the right height.
  75. +  */
  76. +     static int
  77. + frame_check_height(topfrp, height)
  78. +     frame_T *topfrp;
  79. +     int        height;
  80. + {
  81. +     frame_T *frp;
  82. +     if (topfrp->fr_height != height)
  83. +     return FALSE;
  84. +     if (topfrp->fr_layout == FR_ROW)
  85. +     for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
  86. +         if (frp->fr_height != height)
  87. +         return FALSE;
  88. +     return TRUE;
  89. + }
  90. + #ifdef FEAT_VERTSPLIT
  91. + /*
  92. +  * Return TRUE if "topfrp" and its children are at the right width.
  93. +  */
  94. +     static int
  95. + frame_check_width(topfrp, width)
  96. +     frame_T *topfrp;
  97. +     int        width;
  98. + {
  99. +     frame_T *frp;
  100. +     if (topfrp->fr_width != width)
  101. +     return FALSE;
  102. +     if (topfrp->fr_layout == FR_COL)
  103. +     for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next)
  104. +         if (frp->fr_width != width)
  105. +         return FALSE;
  106. +     return TRUE;
  107. + }
  108. + #endif
  109. *** ../vim-7.3.1245/src/version.c    2013-06-26 13:16:13.000000000 +0200
  110. --- src/version.c    2013-06-26 13:47:56.000000000 +0200
  111. ***************
  112. *** 730,731 ****
  113. --- 730,733 ----
  114.   {   /* Add new patch number below this line */
  115. + /**/
  116. +     1246,
  117.   /**/
  118.  
  119. -- 
  120. Back up my hard drive?  I can't find the reverse switch!
  121.  
  122.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  123. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  124. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  125.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  126.