summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.372
blob: 11d0254d4399156b15fbf7bcc131192e82caae2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
To: vim_dev@googlegroups.com
Subject: Patch 7.4.372
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.372
Problem:    When 'winminheight' is zero there might not be one line for the
	    current window.
Solution:   Change the size computations. (Yukihiro Nakadaira)
Files:	    src/window.c


*** ../vim-7.4.371/src/window.c	2014-07-16 16:30:21.647608710 +0200
--- src/window.c	2014-07-16 18:06:53.123491001 +0200
***************
*** 688,693 ****
--- 688,695 ----
      int		before;
      int		minwidth;
      int		minheight;
+     int		wmw1;
+     int		wmh1;
  
      if (flags & WSP_TOP)
  	oldwin = firstwin;
***************
*** 722,740 ****
  	 * Check if we are able to split the current window and compute its
  	 * width.
  	 */
! 	needed = p_wmw + 1;
  	if (flags & WSP_ROOM)
! 	    needed += p_wiw - p_wmw;
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
! 	    minwidth = frame_minwidth(topframe, NULL);
  	    available = topframe->fr_width;
  	    needed += minwidth;
  	}
  	else
  	{
! 	    minwidth = frame_minwidth(oldwin->w_frame, NULL);
! 	    available = oldwin->w_width;
  	}
  	if (available < needed && new_wp == NULL)
  	{
--- 724,745 ----
  	 * Check if we are able to split the current window and compute its
  	 * width.
  	 */
! 	/* Current window requires at least 1 space. */
! 	wmw1 = (p_wmw == 0 ? 1 : p_wmw);
! 	needed = wmw1 + 1;
  	if (flags & WSP_ROOM)
! 	    needed += p_wiw - wmw1;
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
! 	    minwidth = frame_minwidth(topframe, NOWIN);
  	    available = topframe->fr_width;
  	    needed += minwidth;
  	}
  	else
  	{
! 	    minwidth = frame_minwidth(oldwin->w_frame, NOWIN);
! 	    available = oldwin->w_frame->fr_width;
! 	    needed += minwidth;
  	}
  	if (available < needed && new_wp == NULL)
  	{
***************
*** 743,754 ****
  	}
  	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 it doesn't fit in the current window, need win_equal() */
  	if (oldwin->w_width - new_size - 1 < p_wmw)
--- 748,757 ----
  	}
  	if (new_size == 0)
  	    new_size = oldwin->w_width / 2;
  	if (new_size > available - minwidth - 1)
  	    new_size = available - minwidth - 1;
! 	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,808 ****
  	 * Check if we are able to split the current window and compute its
  	 * height.
  	 */
! 	needed = p_wmh + STATUS_HEIGHT + need_status;
  	if (flags & WSP_ROOM)
! 	    needed += p_wh - p_wmh;
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
! 	    minheight = frame_minheight(topframe, NULL);
  	    available = topframe->fr_height;
  	    needed += minheight;
  	}
  	else
  	{
! 	    minheight = frame_minheight(oldwin->w_frame, NULL);
! 	    available = oldwin->w_height;
! 	    needed += p_wmh;
  	}
  	if (available < needed && new_wp == NULL)
  	{
--- 792,813 ----
  	 * Check if we are able to split the current window and compute its
  	 * height.
  	 */
! 	/* 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 - wmh1;
  	if (p_ea || (flags & (WSP_BOT | WSP_TOP)))
  	{
! 	    minheight = frame_minheight(topframe, NOWIN) + need_status;
  	    available = topframe->fr_height;
  	    needed += minheight;
  	}
  	else
  	{
! 	    minheight = frame_minheight(oldwin->w_frame, NOWIN) + need_status;
! 	    available = oldwin->w_frame->fr_height;
! 	    needed += minheight;
  	}
  	if (available < needed && new_wp == NULL)
  	{
***************
*** 817,829 ****
  	}
  	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 it doesn't fit in the current window, need win_equal() */
  	if (oldwin_height - new_size - STATUS_HEIGHT < p_wmh)
--- 822,831 ----
  	}
  	if (new_size == 0)
  	    new_size = oldwin_height / 2;
  	if (new_size > available - minheight - STATUS_HEIGHT)
  	    new_size = available - minheight - STATUS_HEIGHT;
! 	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)
*** ../vim-7.4.371/src/version.c	2014-07-16 17:29:46.691536252 +0200
--- src/version.c	2014-07-16 17:34:14.795530803 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     372,
  /**/

-- 
   [The rest of the ARMY stand around looking at a loss.]
INSPECTOR END OF FILM: (picks up megaphone) All right!  Clear off!  Go on!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- 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    ///