comparison src/window.c @ 1664:f41b6108e46b v7.2a.016

updated for version 7.2a-016
author vimboss
date Mon, 07 Jul 2008 19:23:37 +0000
parents 46bbe11644e0
children f4f8014d516e
comparison
equal deleted inserted replaced
1663:bae8347a9ae1 1664:f41b6108e46b
147 #ifdef FEAT_VERTSPLIT 147 #ifdef FEAT_VERTSPLIT
148 /* split current window in two parts, vertically */ 148 /* split current window in two parts, vertically */
149 case Ctrl_V: 149 case Ctrl_V:
150 case 'v': 150 case 'v':
151 CHECK_CMDWIN 151 CHECK_CMDWIN
152 #ifdef FEAT_VISUAL 152 # ifdef FEAT_VISUAL
153 reset_VIsual_and_resel(); /* stop Visual mode */ 153 reset_VIsual_and_resel(); /* stop Visual mode */
154 #endif 154 # endif
155 #ifdef FEAT_GUI 155 # ifdef FEAT_QUICKFIX
156 /* When splitting the quickfix window open a new buffer in it,
157 * don't replicate the quickfix buffer. */
158 if (bt_quickfix(curbuf))
159 goto newwindow;
160 # endif
161 # ifdef FEAT_GUI
156 need_mouse_correct = TRUE; 162 need_mouse_correct = TRUE;
157 #endif 163 # endif
158 win_split((int)Prenum, WSP_VERT); 164 win_split((int)Prenum, WSP_VERT);
159 break; 165 break;
160 #endif 166 #endif
161 167
162 /* split current window and edit alternate file */ 168 /* split current window and edit alternate file */
166 #ifdef FEAT_VISUAL 172 #ifdef FEAT_VISUAL
167 reset_VIsual_and_resel(); /* stop Visual mode */ 173 reset_VIsual_and_resel(); /* stop Visual mode */
168 #endif 174 #endif
169 STRCPY(cbuf, "split #"); 175 STRCPY(cbuf, "split #");
170 if (Prenum) 176 if (Prenum)
171 sprintf((char *)cbuf + 7, "%ld", Prenum); 177 vim_snprintf((char *)cbuf + 7, sizeof(cbuf) - 7,
178 "%ld", Prenum);
172 do_cmdline_cmd(cbuf); 179 do_cmdline_cmd(cbuf);
173 break; 180 break;
174 181
175 /* open new window */ 182 /* open new window */
176 case Ctrl_N: 183 case Ctrl_N:
181 #endif 188 #endif
182 #ifdef FEAT_QUICKFIX 189 #ifdef FEAT_QUICKFIX
183 newwindow: 190 newwindow:
184 #endif 191 #endif
185 if (Prenum) 192 if (Prenum)
186 sprintf((char *)cbuf, "%ld", Prenum); /* window height */ 193 /* window height */
194 vim_snprintf((char *)cbuf, sizeof(cbuf) - 5, "%ld", Prenum);
187 else 195 else
188 cbuf[0] = NUL; 196 cbuf[0] = NUL;
197 #if defined(FEAT_VERTSPLIT) && defined(FEAT_QUICKFIX)
198 if (nchar == 'v' || nchar == Ctrl_V)
199 STRCAT(cbuf, "v");
200 #endif
189 STRCAT(cbuf, "new"); 201 STRCAT(cbuf, "new");
190 do_cmdline_cmd(cbuf); 202 do_cmdline_cmd(cbuf);
191 break; 203 break;
192 204
193 /* quit current window */ 205 /* quit current window */