Mercurial > vim
annotate src/version.c @ 5269:7d1f89b27103 v7.4b.011
updated for version 7.4b.011
Problem: ":he \%(\)" does not work. (ZyX)
Solution: Add an exception to the list.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 03 Aug 2013 13:41:15 +0200 |
parents | 585b623a1aa3 |
children | 25f67b62afd8 |
rev | line source |
---|---|
7 | 1 /* vi:set ts=8 sts=4 sw=4: |
2 * | |
3 * VIM - Vi IMproved by Bram Moolenaar | |
4 * | |
5 * Do ":help uganda" in Vim to read copying and usage conditions. | |
6 * Do ":help credits" in Vim to see a list of people who contributed. | |
7 * See README.txt for an overview of the Vim source code. | |
8 */ | |
9 | |
10 #include "vim.h" | |
11 | |
12 #ifdef AMIGA | |
13 # include <time.h> /* for time() */ | |
14 #endif | |
15 | |
16 /* | |
17 * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred) | |
18 * It has been changed beyond recognition since then. | |
19 * | |
26 | 20 * Differences between version 6.x and 7.x can be found with ":help version7". |
7 | 21 * Differences between version 5.x and 6.x can be found with ":help version6". |
22 * Differences between version 4.x and 5.x can be found with ":help version5". | |
23 * Differences between version 3.0 and 4.x can be found with ":help version4". | |
24 * All the remarks about older versions have been removed, they are not very | |
25 * interesting. | |
26 */ | |
27 | |
28 #include "version.h" | |
29 | |
378 | 30 char *Version = VIM_VERSION_SHORT; |
31 static char *mediumVersion = VIM_VERSION_MEDIUM; | |
7 | 32 |
33 #if defined(HAVE_DATE_TIME) || defined(PROTO) | |
34 # if (defined(VMS) && defined(VAXC)) || defined(PROTO) | |
35 char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__) | |
36 + sizeof(__TIME__) + 3]; | |
4147 | 37 |
7 | 38 void |
39 make_version() | |
40 { | |
41 /* | |
42 * Construct the long version string. Necessary because | |
43 * VAX C can't catenate strings in the preprocessor. | |
44 */ | |
45 strcpy(longVersion, VIM_VERSION_LONG_DATE); | |
46 strcat(longVersion, __DATE__); | |
47 strcat(longVersion, " "); | |
48 strcat(longVersion, __TIME__); | |
49 strcat(longVersion, ")"); | |
50 } | |
51 # else | |
52 char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")"; | |
53 # endif | |
54 #else | |
55 char *longVersion = VIM_VERSION_LONG; | |
56 #endif | |
57 | |
5166
467efeee8f9e
updated for version 7.4a.009
Bram Moolenaar <bram@vim.org>
parents:
5164
diff
changeset
|
58 static void list_features __ARGS((void)); |
7 | 59 static void version_msg __ARGS((char *s)); |
60 | |
61 static char *(features[]) = | |
62 { | |
63 #ifdef AMIGA /* only for Amiga systems */ | |
64 # ifdef FEAT_ARP | |
65 "+ARP", | |
66 # else | |
67 "-ARP", | |
68 # endif | |
69 #endif | |
70 #ifdef FEAT_ARABIC | |
71 "+arabic", | |
72 #else | |
73 "-arabic", | |
74 #endif | |
75 #ifdef FEAT_AUTOCMD | |
76 "+autocmd", | |
77 #else | |
78 "-autocmd", | |
79 #endif | |
80 #ifdef FEAT_BEVAL | |
81 "+balloon_eval", | |
82 #else | |
83 "-balloon_eval", | |
84 #endif | |
85 #ifdef FEAT_BROWSE | |
86 "+browse", | |
87 #else | |
88 "-browse", | |
89 #endif | |
90 #ifdef NO_BUILTIN_TCAPS | |
91 "-builtin_terms", | |
92 #endif | |
93 #ifdef SOME_BUILTIN_TCAPS | |
94 "+builtin_terms", | |
95 #endif | |
96 #ifdef ALL_BUILTIN_TCAPS | |
97 "++builtin_terms", | |
98 #endif | |
99 #ifdef FEAT_BYTEOFF | |
100 "+byte_offset", | |
101 #else | |
102 "-byte_offset", | |
103 #endif | |
104 #ifdef FEAT_CINDENT | |
105 "+cindent", | |
106 #else | |
107 "-cindent", | |
108 #endif | |
109 #ifdef FEAT_CLIENTSERVER | |
110 "+clientserver", | |
111 #else | |
112 "-clientserver", | |
113 #endif | |
114 #ifdef FEAT_CLIPBOARD | |
115 "+clipboard", | |
116 #else | |
117 "-clipboard", | |
118 #endif | |
119 #ifdef FEAT_CMDL_COMPL | |
120 "+cmdline_compl", | |
121 #else | |
122 "-cmdline_compl", | |
123 #endif | |
124 #ifdef FEAT_CMDHIST | |
125 "+cmdline_hist", | |
126 #else | |
127 "-cmdline_hist", | |
128 #endif | |
129 #ifdef FEAT_CMDL_INFO | |
130 "+cmdline_info", | |
131 #else | |
132 "-cmdline_info", | |
133 #endif | |
134 #ifdef FEAT_COMMENTS | |
135 "+comments", | |
136 #else | |
137 "-comments", | |
138 #endif | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
139 #ifdef FEAT_CONCEAL |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
140 "+conceal", |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
141 #else |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
142 "-conceal", |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
143 #endif |
7 | 144 #ifdef FEAT_CRYPT |
145 "+cryptv", | |
146 #else | |
147 "-cryptv", | |
148 #endif | |
149 #ifdef FEAT_CSCOPE | |
150 "+cscope", | |
151 #else | |
152 "-cscope", | |
153 #endif | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
154 #ifdef FEAT_CURSORBIND |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
155 "+cursorbind", |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
156 #else |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
157 "-cursorbind", |
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
158 #endif |
647 | 159 #ifdef CURSOR_SHAPE |
160 "+cursorshape", | |
161 #else | |
162 "-cursorshape", | |
163 #endif | |
7 | 164 #if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG) |
165 "+dialog_con_gui", | |
166 #else | |
167 # if defined(FEAT_CON_DIALOG) | |
168 "+dialog_con", | |
169 # else | |
170 # if defined(FEAT_GUI_DIALOG) | |
171 "+dialog_gui", | |
172 # else | |
173 "-dialog", | |
174 # endif | |
175 # endif | |
176 #endif | |
177 #ifdef FEAT_DIFF | |
178 "+diff", | |
179 #else | |
180 "-diff", | |
181 #endif | |
182 #ifdef FEAT_DIGRAPHS | |
183 "+digraphs", | |
184 #else | |
185 "-digraphs", | |
186 #endif | |
187 #ifdef FEAT_DND | |
188 "+dnd", | |
189 #else | |
190 "-dnd", | |
191 #endif | |
192 #ifdef EBCDIC | |
193 "+ebcdic", | |
194 #else | |
195 "-ebcdic", | |
196 #endif | |
197 #ifdef FEAT_EMACS_TAGS | |
198 "+emacs_tags", | |
199 #else | |
200 "-emacs_tags", | |
201 #endif | |
202 #ifdef FEAT_EVAL | |
203 "+eval", | |
204 #else | |
205 "-eval", | |
206 #endif | |
207 #ifdef FEAT_EX_EXTRA | |
208 "+ex_extra", | |
209 #else | |
210 "-ex_extra", | |
211 #endif | |
212 #ifdef FEAT_SEARCH_EXTRA | |
213 "+extra_search", | |
214 #else | |
215 "-extra_search", | |
216 #endif | |
217 #ifdef FEAT_FKMAP | |
218 "+farsi", | |
219 #else | |
220 "-farsi", | |
221 #endif | |
222 #ifdef FEAT_SEARCHPATH | |
223 "+file_in_path", | |
224 #else | |
225 "-file_in_path", | |
226 #endif | |
227 #ifdef FEAT_FIND_ID | |
228 "+find_in_path", | |
229 #else | |
230 "-find_in_path", | |
231 #endif | |
1621 | 232 #ifdef FEAT_FLOAT |
233 "+float", | |
234 #else | |
235 "-float", | |
236 #endif | |
7 | 237 #ifdef FEAT_FOLDING |
238 "+folding", | |
239 #else | |
240 "-folding", | |
241 #endif | |
242 #ifdef FEAT_FOOTER | |
243 "+footer", | |
244 #else | |
245 "-footer", | |
246 #endif | |
247 /* only interesting on Unix systems */ | |
248 #if !defined(USE_SYSTEM) && defined(UNIX) | |
249 "+fork()", | |
250 #endif | |
251 #ifdef FEAT_GETTEXT | |
252 # ifdef DYNAMIC_GETTEXT | |
253 "+gettext/dyn", | |
254 # else | |
255 "+gettext", | |
256 # endif | |
257 #else | |
258 "-gettext", | |
259 #endif | |
260 #ifdef FEAT_HANGULIN | |
261 "+hangul_input", | |
262 #else | |
263 "-hangul_input", | |
264 #endif | |
265 #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV) | |
266 # ifdef DYNAMIC_ICONV | |
267 "+iconv/dyn", | |
268 # else | |
269 "+iconv", | |
270 # endif | |
271 #else | |
272 "-iconv", | |
273 #endif | |
274 #ifdef FEAT_INS_EXPAND | |
275 "+insert_expand", | |
276 #else | |
277 "-insert_expand", | |
278 #endif | |
279 #ifdef FEAT_JUMPLIST | |
280 "+jumplist", | |
281 #else | |
282 "-jumplist", | |
283 #endif | |
284 #ifdef FEAT_KEYMAP | |
285 "+keymap", | |
286 #else | |
287 "-keymap", | |
288 #endif | |
289 #ifdef FEAT_LANGMAP | |
290 "+langmap", | |
291 #else | |
292 "-langmap", | |
293 #endif | |
294 #ifdef FEAT_LIBCALL | |
295 "+libcall", | |
296 #else | |
297 "-libcall", | |
298 #endif | |
299 #ifdef FEAT_LINEBREAK | |
300 "+linebreak", | |
301 #else | |
302 "-linebreak", | |
303 #endif | |
304 #ifdef FEAT_LISP | |
305 "+lispindent", | |
306 #else | |
307 "-lispindent", | |
308 #endif | |
309 #ifdef FEAT_LISTCMDS | |
310 "+listcmds", | |
311 #else | |
312 "-listcmds", | |
313 #endif | |
314 #ifdef FEAT_LOCALMAP | |
315 "+localmap", | |
316 #else | |
317 "-localmap", | |
318 #endif | |
2320
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
319 #ifdef FEAT_LUA |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
320 # ifdef DYNAMIC_LUA |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
321 "+lua/dyn", |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
322 # else |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
323 "+lua", |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
324 # endif |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
325 #else |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
326 "-lua", |
966a5609669e
Added Lua interfae. (Luis Carvalho)
Bram Moolenaar <bram@vim.org>
parents:
2275
diff
changeset
|
327 #endif |
7 | 328 #ifdef FEAT_MENU |
329 "+menu", | |
330 #else | |
331 "-menu", | |
332 #endif | |
333 #ifdef FEAT_SESSION | |
334 "+mksession", | |
335 #else | |
336 "-mksession", | |
337 #endif | |
338 #ifdef FEAT_MODIFY_FNAME | |
339 "+modify_fname", | |
340 #else | |
341 "-modify_fname", | |
342 #endif | |
343 #ifdef FEAT_MOUSE | |
344 "+mouse", | |
345 # ifdef FEAT_MOUSESHAPE | |
346 "+mouseshape", | |
347 # else | |
348 "-mouseshape", | |
349 # endif | |
350 # else | |
351 "-mouse", | |
352 #endif | |
3898 | 353 |
7 | 354 #if defined(UNIX) || defined(VMS) |
355 # ifdef FEAT_MOUSE_DEC | |
356 "+mouse_dec", | |
357 # else | |
358 "-mouse_dec", | |
359 # endif | |
360 # ifdef FEAT_MOUSE_GPM | |
361 "+mouse_gpm", | |
362 # else | |
363 "-mouse_gpm", | |
364 # endif | |
365 # ifdef FEAT_MOUSE_JSB | |
366 "+mouse_jsbterm", | |
367 # else | |
368 "-mouse_jsbterm", | |
369 # endif | |
370 # ifdef FEAT_MOUSE_NET | |
371 "+mouse_netterm", | |
372 # else | |
373 "-mouse_netterm", | |
374 # endif | |
375 #endif | |
3898 | 376 |
7 | 377 #ifdef __QNX__ |
378 # ifdef FEAT_MOUSE_PTERM | |
379 "+mouse_pterm", | |
380 # else | |
381 "-mouse_pterm", | |
382 # endif | |
383 #endif | |
3898 | 384 |
385 #if defined(UNIX) || defined(VMS) | |
386 # ifdef FEAT_MOUSE_SGR | |
387 "+mouse_sgr", | |
388 # else | |
389 "-mouse_sgr", | |
390 # endif | |
391 # ifdef FEAT_SYSMOUSE | |
392 "+mouse_sysmouse", | |
393 # else | |
394 "-mouse_sysmouse", | |
395 # endif | |
396 # ifdef FEAT_MOUSE_URXVT | |
397 "+mouse_urxvt", | |
398 # else | |
399 "-mouse_urxvt", | |
400 # endif | |
401 # ifdef FEAT_MOUSE_XTERM | |
402 "+mouse_xterm", | |
403 # else | |
404 "-mouse_xterm", | |
405 # endif | |
406 #endif | |
407 | |
7 | 408 #ifdef FEAT_MBYTE_IME |
409 # ifdef DYNAMIC_IME | |
410 "+multi_byte_ime/dyn", | |
411 # else | |
412 "+multi_byte_ime", | |
413 # endif | |
414 #else | |
415 # ifdef FEAT_MBYTE | |
416 "+multi_byte", | |
417 # else | |
418 "-multi_byte", | |
419 # endif | |
420 #endif | |
421 #ifdef FEAT_MULTI_LANG | |
422 "+multi_lang", | |
423 #else | |
424 "-multi_lang", | |
425 #endif | |
14 | 426 #ifdef FEAT_MZSCHEME |
132 | 427 # ifdef DYNAMIC_MZSCHEME |
428 "+mzscheme/dyn", | |
429 # else | |
14 | 430 "+mzscheme", |
132 | 431 # endif |
14 | 432 #else |
433 "-mzscheme", | |
434 #endif | |
7 | 435 #ifdef FEAT_NETBEANS_INTG |
436 "+netbeans_intg", | |
437 #else | |
438 "-netbeans_intg", | |
439 #endif | |
440 #ifdef FEAT_GUI_W32 | |
441 # ifdef FEAT_OLE | |
442 "+ole", | |
443 # else | |
444 "-ole", | |
445 # endif | |
446 #endif | |
447 #ifdef FEAT_PATH_EXTRA | |
448 "+path_extra", | |
449 #else | |
450 "-path_extra", | |
451 #endif | |
452 #ifdef FEAT_PERL | |
453 # ifdef DYNAMIC_PERL | |
454 "+perl/dyn", | |
455 # else | |
456 "+perl", | |
457 # endif | |
458 #else | |
459 "-perl", | |
460 #endif | |
2214
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
461 #ifdef FEAT_PERSISTENT_UNDO |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
462 "+persistent_undo", |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
463 #else |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
464 "-persistent_undo", |
f8222d1f9a73
Included patch for persistent undo. Lots of changes and added test.
Bram Moolenaar <bram@vim.org>
parents:
2154
diff
changeset
|
465 #endif |
7 | 466 #ifdef FEAT_PRINTER |
467 # ifdef FEAT_POSTSCRIPT | |
468 "+postscript", | |
469 # else | |
470 "-postscript", | |
471 # endif | |
472 "+printer", | |
473 #else | |
474 "-printer", | |
475 #endif | |
170 | 476 #ifdef FEAT_PROFILE |
477 "+profile", | |
478 #else | |
479 "-profile", | |
480 #endif | |
7 | 481 #ifdef FEAT_PYTHON |
482 # ifdef DYNAMIC_PYTHON | |
483 "+python/dyn", | |
484 # else | |
485 "+python", | |
486 # endif | |
487 #else | |
488 "-python", | |
489 #endif | |
2329
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
490 #ifdef FEAT_PYTHON3 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
491 # ifdef DYNAMIC_PYTHON3 |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
492 "+python3/dyn", |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
493 # else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
494 "+python3", |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
495 # endif |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
496 #else |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
497 "-python3", |
ad2889f48843
Added support for Python 3. (Roland Puntaier)
Bram Moolenaar <bram@vim.org>
parents:
2320
diff
changeset
|
498 #endif |
7 | 499 #ifdef FEAT_QUICKFIX |
500 "+quickfix", | |
501 #else | |
502 "-quickfix", | |
503 #endif | |
857 | 504 #ifdef FEAT_RELTIME |
505 "+reltime", | |
506 #else | |
507 "-reltime", | |
508 #endif | |
7 | 509 #ifdef FEAT_RIGHTLEFT |
510 "+rightleft", | |
511 #else | |
512 "-rightleft", | |
513 #endif | |
514 #ifdef FEAT_RUBY | |
515 # ifdef DYNAMIC_RUBY | |
516 "+ruby/dyn", | |
517 # else | |
518 "+ruby", | |
519 # endif | |
520 #else | |
521 "-ruby", | |
522 #endif | |
523 #ifdef FEAT_SCROLLBIND | |
524 "+scrollbind", | |
525 #else | |
526 "-scrollbind", | |
527 #endif | |
528 #ifdef FEAT_SIGNS | |
529 "+signs", | |
530 #else | |
531 "-signs", | |
532 #endif | |
533 #ifdef FEAT_SMARTINDENT | |
534 "+smartindent", | |
535 #else | |
536 "-smartindent", | |
537 #endif | |
538 #ifdef FEAT_SNIFF | |
539 "+sniff", | |
540 #else | |
541 "-sniff", | |
542 #endif | |
1989 | 543 #ifdef STARTUPTIME |
544 "+startuptime", | |
545 #else | |
546 "-startuptime", | |
547 #endif | |
7 | 548 #ifdef FEAT_STL_OPT |
549 "+statusline", | |
550 #else | |
551 "-statusline", | |
552 #endif | |
553 #ifdef FEAT_SUN_WORKSHOP | |
554 "+sun_workshop", | |
555 #else | |
556 "-sun_workshop", | |
557 #endif | |
558 #ifdef FEAT_SYN_HL | |
559 "+syntax", | |
560 #else | |
561 "-syntax", | |
562 #endif | |
563 /* only interesting on Unix systems */ | |
564 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__)) | |
565 "+system()", | |
566 #endif | |
567 #ifdef FEAT_TAG_BINS | |
568 "+tag_binary", | |
569 #else | |
570 "-tag_binary", | |
571 #endif | |
572 #ifdef FEAT_TAG_OLDSTATIC | |
573 "+tag_old_static", | |
574 #else | |
575 "-tag_old_static", | |
576 #endif | |
577 #ifdef FEAT_TAG_ANYWHITE | |
578 "+tag_any_white", | |
579 #else | |
580 "-tag_any_white", | |
581 #endif | |
582 #ifdef FEAT_TCL | |
583 # ifdef DYNAMIC_TCL | |
584 "+tcl/dyn", | |
585 # else | |
586 "+tcl", | |
587 # endif | |
588 #else | |
589 "-tcl", | |
590 #endif | |
591 #if defined(UNIX) || defined(__EMX__) | |
592 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */ | |
593 # ifdef TERMINFO | |
594 "+terminfo", | |
595 # else | |
596 "-terminfo", | |
597 # endif | |
598 #else /* unix always includes termcap support */ | |
599 # ifdef HAVE_TGETENT | |
600 "+tgetent", | |
601 # else | |
602 "-tgetent", | |
603 # endif | |
604 #endif | |
605 #ifdef FEAT_TERMRESPONSE | |
606 "+termresponse", | |
607 #else | |
608 "-termresponse", | |
609 #endif | |
610 #ifdef FEAT_TEXTOBJ | |
611 "+textobjects", | |
612 #else | |
613 "-textobjects", | |
614 #endif | |
615 #ifdef FEAT_TITLE | |
616 "+title", | |
617 #else | |
618 "-title", | |
619 #endif | |
620 #ifdef FEAT_TOOLBAR | |
621 "+toolbar", | |
622 #else | |
623 "-toolbar", | |
624 #endif | |
625 #ifdef FEAT_USR_CMDS | |
626 "+user_commands", | |
627 #else | |
628 "-user_commands", | |
629 #endif | |
630 #ifdef FEAT_VERTSPLIT | |
631 "+vertsplit", | |
632 #else | |
633 "-vertsplit", | |
634 #endif | |
635 #ifdef FEAT_VIRTUALEDIT | |
636 "+virtualedit", | |
637 #else | |
638 "-virtualedit", | |
639 #endif | |
640 #ifdef FEAT_VISUAL | |
641 "+visual", | |
642 # ifdef FEAT_VISUALEXTRA | |
643 "+visualextra", | |
644 # else | |
645 "-visualextra", | |
646 # endif | |
647 #else | |
648 "-visual", | |
649 #endif | |
650 #ifdef FEAT_VIMINFO | |
651 "+viminfo", | |
652 #else | |
653 "-viminfo", | |
654 #endif | |
655 #ifdef FEAT_VREPLACE | |
656 "+vreplace", | |
657 #else | |
658 "-vreplace", | |
659 #endif | |
660 #ifdef FEAT_WILDIGN | |
661 "+wildignore", | |
662 #else | |
663 "-wildignore", | |
664 #endif | |
665 #ifdef FEAT_WILDMENU | |
666 "+wildmenu", | |
667 #else | |
668 "-wildmenu", | |
669 #endif | |
670 #ifdef FEAT_WINDOWS | |
671 "+windows", | |
672 #else | |
673 "-windows", | |
674 #endif | |
675 #ifdef FEAT_WRITEBACKUP | |
676 "+writebackup", | |
677 #else | |
678 "-writebackup", | |
679 #endif | |
680 #if defined(UNIX) || defined(VMS) | |
681 # ifdef FEAT_X11 | |
682 "+X11", | |
683 # else | |
684 "-X11", | |
685 # endif | |
686 #endif | |
687 #ifdef FEAT_XFONTSET | |
688 "+xfontset", | |
689 #else | |
690 "-xfontset", | |
691 #endif | |
692 #ifdef FEAT_XIM | |
693 "+xim", | |
694 #else | |
695 "-xim", | |
696 #endif | |
697 #if defined(UNIX) || defined(VMS) | |
698 # ifdef USE_XSMP_INTERACT | |
699 "+xsmp_interact", | |
700 # else | |
701 # ifdef USE_XSMP | |
702 "+xsmp", | |
703 # else | |
704 "-xsmp", | |
705 # endif | |
706 # endif | |
707 # ifdef FEAT_XCLIPBOARD | |
708 "+xterm_clipboard", | |
709 # else | |
710 "-xterm_clipboard", | |
711 # endif | |
712 #endif | |
713 #ifdef FEAT_XTERM_SAVE | |
714 "+xterm_save", | |
715 #else | |
716 "-xterm_save", | |
717 #endif | |
718 #ifdef WIN3264 | |
719 # ifdef FEAT_XPM_W32 | |
720 "+xpm_w32", | |
721 # else | |
722 "-xpm_w32", | |
723 # endif | |
724 #endif | |
725 NULL | |
726 }; | |
727 | |
728 static int included_patches[] = | |
729 { /* Add new patch number below this line */ | |
730 /**/ | |
5269
7d1f89b27103
updated for version 7.4b.011
Bram Moolenaar <bram@vim.org>
parents:
5267
diff
changeset
|
731 11, |
7d1f89b27103
updated for version 7.4b.011
Bram Moolenaar <bram@vim.org>
parents:
5267
diff
changeset
|
732 /**/ |
5267
585b623a1aa3
updated for version 7.4b.010
Bram Moolenaar <bram@vim.org>
parents:
5265
diff
changeset
|
733 10, |
585b623a1aa3
updated for version 7.4b.010
Bram Moolenaar <bram@vim.org>
parents:
5265
diff
changeset
|
734 /**/ |
5265
cd971e951b06
updated for version 7.4b.009
Bram Moolenaar <bram@vim.org>
parents:
5263
diff
changeset
|
735 9, |
cd971e951b06
updated for version 7.4b.009
Bram Moolenaar <bram@vim.org>
parents:
5263
diff
changeset
|
736 /**/ |
5263
3059c799fcd9
updated for version 7.4b.008
Bram Moolenaar <bram@vim.org>
parents:
5261
diff
changeset
|
737 8, |
3059c799fcd9
updated for version 7.4b.008
Bram Moolenaar <bram@vim.org>
parents:
5261
diff
changeset
|
738 /**/ |
5261
b882d4b14e00
updated for version 7.4b.007
Bram Moolenaar <bram@vim.org>
parents:
5259
diff
changeset
|
739 7, |
b882d4b14e00
updated for version 7.4b.007
Bram Moolenaar <bram@vim.org>
parents:
5259
diff
changeset
|
740 /**/ |
5259
6b7ab6a4f31a
updated for version 7.4b.006
Bram Moolenaar <bram@vim.org>
parents:
5257
diff
changeset
|
741 6, |
6b7ab6a4f31a
updated for version 7.4b.006
Bram Moolenaar <bram@vim.org>
parents:
5257
diff
changeset
|
742 /**/ |
5257
e63e4b4be923
updated for version 7.4b.005
Bram Moolenaar <bram@vim.org>
parents:
5255
diff
changeset
|
743 5, |
e63e4b4be923
updated for version 7.4b.005
Bram Moolenaar <bram@vim.org>
parents:
5255
diff
changeset
|
744 /**/ |
5255
3c6e2b89875f
updated for version 7.4b.004
Bram Moolenaar <bram@vim.org>
parents:
5253
diff
changeset
|
745 4, |
3c6e2b89875f
updated for version 7.4b.004
Bram Moolenaar <bram@vim.org>
parents:
5253
diff
changeset
|
746 /**/ |
5253
ea876fe91483
updated for version 7.4b.003
Bram Moolenaar <bram@vim.org>
parents:
5251
diff
changeset
|
747 3, |
ea876fe91483
updated for version 7.4b.003
Bram Moolenaar <bram@vim.org>
parents:
5251
diff
changeset
|
748 /**/ |
5251
2e63b6c763f7
updated for version 7.4b.002
Bram Moolenaar <bram@vim.org>
parents:
5249
diff
changeset
|
749 2, |
2e63b6c763f7
updated for version 7.4b.002
Bram Moolenaar <bram@vim.org>
parents:
5249
diff
changeset
|
750 /**/ |
5249
47a09a572ea6
updated for version 7.4b.001
Bram Moolenaar <bram@vim.org>
parents:
5247
diff
changeset
|
751 1, |
47a09a572ea6
updated for version 7.4b.001
Bram Moolenaar <bram@vim.org>
parents:
5247
diff
changeset
|
752 /**/ |
7 | 753 0 |
754 }; | |
755 | |
1760 | 756 /* |
757 * Place to put a short description when adding a feature with a patch. | |
758 * Keep it short, e.g.,: "relative numbers", "persistent undo". | |
759 * Also add a comment marker to separate the lines. | |
760 * See the official Vim patches for the diff format: It must use a context of | |
1777 | 761 * one line only. Create it by hand or use "diff -C2" and edit the patch. |
1760 | 762 */ |
763 static char *(extra_patches[]) = | |
764 { /* Add your patch description below this line */ | |
765 /**/ | |
766 NULL | |
767 }; | |
768 | |
7 | 769 int |
770 highest_patch() | |
771 { | |
772 int i; | |
773 int h = 0; | |
774 | |
775 for (i = 0; included_patches[i] != 0; ++i) | |
776 if (included_patches[i] > h) | |
777 h = included_patches[i]; | |
778 return h; | |
779 } | |
780 | |
781 #if defined(FEAT_EVAL) || defined(PROTO) | |
782 /* | |
783 * Return TRUE if patch "n" has been included. | |
784 */ | |
785 int | |
786 has_patch(n) | |
787 int n; | |
788 { | |
789 int i; | |
790 | |
791 for (i = 0; included_patches[i] != 0; ++i) | |
792 if (included_patches[i] == n) | |
793 return TRUE; | |
794 return FALSE; | |
795 } | |
796 #endif | |
797 | |
798 void | |
799 ex_version(eap) | |
800 exarg_T *eap; | |
801 { | |
802 /* | |
803 * Ignore a ":version 9.99" command. | |
804 */ | |
805 if (*eap->arg == NUL) | |
806 { | |
807 msg_putchar('\n'); | |
808 list_version(); | |
809 } | |
810 } | |
811 | |
4147 | 812 /* |
813 * List all features aligned in columns, dictionary style. | |
814 */ | |
815 static void | |
816 list_features() | |
817 { | |
818 int i; | |
819 int ncol; | |
820 int nrow; | |
821 int nfeat = 0; | |
822 int width = 0; | |
823 | |
824 /* Find the length of the longest feature name, use that + 1 as the column | |
825 * width */ | |
826 for (i = 0; features[i] != NULL; ++i) | |
827 { | |
4160 | 828 int l = (int)STRLEN(features[i]); |
4147 | 829 |
830 if (l > width) | |
831 width = l; | |
832 ++nfeat; | |
833 } | |
834 width += 1; | |
835 | |
836 if (Columns < width) | |
837 { | |
838 /* Not enough screen columns - show one per line */ | |
839 for (i = 0; features[i] != NULL; ++i) | |
840 { | |
841 version_msg(features[i]); | |
842 if (msg_col > 0) | |
843 msg_putchar('\n'); | |
844 } | |
845 return; | |
846 } | |
847 | |
848 /* The rightmost column doesn't need a separator. | |
849 * Sacrifice it to fit in one more column if possible. */ | |
4170 | 850 ncol = (int) (Columns + 1) / width; |
4147 | 851 nrow = nfeat / ncol + (nfeat % ncol ? 1 : 0); |
852 | |
4170 | 853 /* i counts columns then rows. idx counts rows then columns. */ |
4147 | 854 for (i = 0; !got_int && i < nrow * ncol; ++i) |
855 { | |
856 int idx = (i / ncol) + (i % ncol) * nrow; | |
857 | |
858 if (idx < nfeat) | |
859 { | |
860 int last_col = (i + 1) % ncol == 0; | |
861 | |
862 msg_puts((char_u *)features[idx]); | |
863 if (last_col) | |
864 { | |
865 if (msg_col > 0) | |
866 msg_putchar('\n'); | |
867 } | |
868 else | |
869 { | |
870 while (msg_col % width) | |
871 msg_putchar(' '); | |
872 } | |
873 } | |
874 else | |
4170 | 875 { |
876 if (msg_col > 0) | |
877 msg_putchar('\n'); | |
878 } | |
4147 | 879 } |
880 } | |
4160 | 881 |
7 | 882 void |
883 list_version() | |
884 { | |
885 int i; | |
886 int first; | |
887 char *s = ""; | |
888 | |
889 /* | |
890 * When adding features here, don't forget to update the list of | |
891 * internal variables in eval.c! | |
892 */ | |
893 MSG(longVersion); | |
894 #ifdef WIN3264 | |
895 # ifdef FEAT_GUI_W32 | |
896 # if defined(_MSC_VER) && (_MSC_VER <= 1010) | |
897 /* Only MS VC 4.1 and earlier can do Win32s */ | |
1607 | 898 MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version")); |
7 | 899 # else |
990 | 900 # ifdef _WIN64 |
1607 | 901 MSG_PUTS(_("\nMS-Windows 64-bit GUI version")); |
990 | 902 # else |
1607 | 903 MSG_PUTS(_("\nMS-Windows 32-bit GUI version")); |
990 | 904 # endif |
7 | 905 # endif |
906 if (gui_is_win32s()) | |
907 MSG_PUTS(_(" in Win32s mode")); | |
908 # ifdef FEAT_OLE | |
909 MSG_PUTS(_(" with OLE support")); | |
910 # endif | |
911 # else | |
1607 | 912 # ifdef _WIN64 |
913 MSG_PUTS(_("\nMS-Windows 64-bit console version")); | |
914 # else | |
915 MSG_PUTS(_("\nMS-Windows 32-bit console version")); | |
916 # endif | |
7 | 917 # endif |
918 #endif | |
919 #ifdef WIN16 | |
1607 | 920 MSG_PUTS(_("\nMS-Windows 16-bit version")); |
7 | 921 #endif |
922 #ifdef MSDOS | |
923 # ifdef DJGPP | |
1607 | 924 MSG_PUTS(_("\n32-bit MS-DOS version")); |
7 | 925 # else |
1607 | 926 MSG_PUTS(_("\n16-bit MS-DOS version")); |
7 | 927 # endif |
928 #endif | |
929 #ifdef MACOS | |
930 # ifdef MACOS_X | |
931 # ifdef MACOS_X_UNIX | |
932 MSG_PUTS(_("\nMacOS X (unix) version")); | |
933 # else | |
934 MSG_PUTS(_("\nMacOS X version")); | |
935 # endif | |
936 #else | |
937 MSG_PUTS(_("\nMacOS version")); | |
938 # endif | |
939 #endif | |
940 | |
941 #ifdef VMS | |
1705 | 942 MSG_PUTS(_("\nOpenVMS version")); |
1045 | 943 # ifdef HAVE_PATHDEF |
944 if (*compiled_arch != NUL) | |
945 { | |
946 MSG_PUTS(" - "); | |
947 MSG_PUTS(compiled_arch); | |
948 } | |
949 # endif | |
950 | |
7 | 951 #endif |
952 | |
953 /* Print the list of patch numbers if there is at least one. */ | |
954 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */ | |
955 if (included_patches[0] != 0) | |
956 { | |
957 MSG_PUTS(_("\nIncluded patches: ")); | |
958 first = -1; | |
959 /* find last one */ | |
960 for (i = 0; included_patches[i] != 0; ++i) | |
961 ; | |
962 while (--i >= 0) | |
963 { | |
964 if (first < 0) | |
965 first = included_patches[i]; | |
966 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1) | |
967 { | |
968 MSG_PUTS(s); | |
969 s = ", "; | |
970 msg_outnum((long)first); | |
971 if (first != included_patches[i]) | |
972 { | |
973 MSG_PUTS("-"); | |
974 msg_outnum((long)included_patches[i]); | |
975 } | |
976 first = -1; | |
977 } | |
978 } | |
979 } | |
980 | |
1760 | 981 /* Print the list of extra patch descriptions if there is at least one. */ |
982 if (extra_patches[0] != NULL) | |
983 { | |
984 MSG_PUTS(_("\nExtra patches: ")); | |
985 s = ""; | |
986 for (i = 0; extra_patches[i] != NULL; ++i) | |
987 { | |
988 MSG_PUTS(s); | |
989 s = ", "; | |
990 MSG_PUTS(extra_patches[i]); | |
991 } | |
992 } | |
993 | |
7 | 994 #ifdef MODIFIED_BY |
995 MSG_PUTS("\n"); | |
996 MSG_PUTS(_("Modified by ")); | |
997 MSG_PUTS(MODIFIED_BY); | |
998 #endif | |
999 | |
1000 #ifdef HAVE_PATHDEF | |
1001 if (*compiled_user != NUL || *compiled_sys != NUL) | |
1002 { | |
1003 MSG_PUTS(_("\nCompiled ")); | |
1004 if (*compiled_user != NUL) | |
1005 { | |
1006 MSG_PUTS(_("by ")); | |
1007 MSG_PUTS(compiled_user); | |
1008 } | |
1009 if (*compiled_sys != NUL) | |
1010 { | |
1011 MSG_PUTS("@"); | |
1012 MSG_PUTS(compiled_sys); | |
1013 } | |
1014 } | |
1015 #endif | |
1016 | |
1017 #ifdef FEAT_HUGE | |
1018 MSG_PUTS(_("\nHuge version ")); | |
1019 #else | |
1020 # ifdef FEAT_BIG | |
1021 MSG_PUTS(_("\nBig version ")); | |
1022 # else | |
1023 # ifdef FEAT_NORMAL | |
1024 MSG_PUTS(_("\nNormal version ")); | |
1025 # else | |
1026 # ifdef FEAT_SMALL | |
1027 MSG_PUTS(_("\nSmall version ")); | |
1028 # else | |
1029 MSG_PUTS(_("\nTiny version ")); | |
1030 # endif | |
1031 # endif | |
1032 # endif | |
1033 #endif | |
1034 #ifndef FEAT_GUI | |
1035 MSG_PUTS(_("without GUI.")); | |
1036 #else | |
1037 # ifdef FEAT_GUI_GTK | |
1038 # ifdef FEAT_GUI_GNOME | |
1039 MSG_PUTS(_("with GTK2-GNOME GUI.")); | |
1040 # else | |
1041 MSG_PUTS(_("with GTK2 GUI.")); | |
1042 # endif | |
1043 # else | |
1044 # ifdef FEAT_GUI_MOTIF | |
1045 MSG_PUTS(_("with X11-Motif GUI.")); | |
1046 # else | |
1047 # ifdef FEAT_GUI_ATHENA | |
1048 # ifdef FEAT_GUI_NEXTAW | |
1049 MSG_PUTS(_("with X11-neXtaw GUI.")); | |
1050 # else | |
1051 MSG_PUTS(_("with X11-Athena GUI.")); | |
1052 # endif | |
1053 # else | |
1054 # ifdef FEAT_GUI_PHOTON | |
1055 MSG_PUTS(_("with Photon GUI.")); | |
1056 # else | |
1057 # if defined(MSWIN) | |
1058 MSG_PUTS(_("with GUI.")); | |
1059 # else | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
1060 # if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON |
7 | 1061 MSG_PUTS(_("with Carbon GUI.")); |
1062 # else | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
1063 # if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX |
7 | 1064 MSG_PUTS(_("with Cocoa GUI.")); |
1065 # else | |
2250
1bac28a53fae
Add the conceal patch from Vince Negri.
Bram Moolenaar <bram@vim.org>
parents:
2214
diff
changeset
|
1066 # if defined(MACOS) |
7 | 1067 MSG_PUTS(_("with (classic) GUI.")); |
1068 # endif | |
1069 # endif | |
1070 # endif | |
1071 # endif | |
1072 # endif | |
1073 # endif | |
1074 # endif | |
1075 # endif | |
1076 #endif | |
1077 version_msg(_(" Features included (+) or not (-):\n")); | |
1078 | |
4147 | 1079 list_features(); |
7 | 1080 |
1081 #ifdef SYS_VIMRC_FILE | |
1082 version_msg(_(" system vimrc file: \"")); | |
1083 version_msg(SYS_VIMRC_FILE); | |
1084 version_msg("\"\n"); | |
1085 #endif | |
1086 #ifdef USR_VIMRC_FILE | |
1087 version_msg(_(" user vimrc file: \"")); | |
1088 version_msg(USR_VIMRC_FILE); | |
1089 version_msg("\"\n"); | |
1090 #endif | |
1091 #ifdef USR_VIMRC_FILE2 | |
1092 version_msg(_(" 2nd user vimrc file: \"")); | |
1093 version_msg(USR_VIMRC_FILE2); | |
1094 version_msg("\"\n"); | |
1095 #endif | |
1096 #ifdef USR_VIMRC_FILE3 | |
1097 version_msg(_(" 3rd user vimrc file: \"")); | |
1098 version_msg(USR_VIMRC_FILE3); | |
1099 version_msg("\"\n"); | |
1100 #endif | |
1101 #ifdef USR_EXRC_FILE | |
1102 version_msg(_(" user exrc file: \"")); | |
1103 version_msg(USR_EXRC_FILE); | |
1104 version_msg("\"\n"); | |
1105 #endif | |
1106 #ifdef USR_EXRC_FILE2 | |
1107 version_msg(_(" 2nd user exrc file: \"")); | |
1108 version_msg(USR_EXRC_FILE2); | |
1109 version_msg("\"\n"); | |
1110 #endif | |
1111 #ifdef FEAT_GUI | |
1112 # ifdef SYS_GVIMRC_FILE | |
1113 version_msg(_(" system gvimrc file: \"")); | |
1114 version_msg(SYS_GVIMRC_FILE); | |
1115 version_msg("\"\n"); | |
1116 # endif | |
1117 version_msg(_(" user gvimrc file: \"")); | |
1118 version_msg(USR_GVIMRC_FILE); | |
1119 version_msg("\"\n"); | |
1120 # ifdef USR_GVIMRC_FILE2 | |
1121 version_msg(_("2nd user gvimrc file: \"")); | |
1122 version_msg(USR_GVIMRC_FILE2); | |
1123 version_msg("\"\n"); | |
1124 # endif | |
1125 # ifdef USR_GVIMRC_FILE3 | |
1126 version_msg(_("3rd user gvimrc file: \"")); | |
1127 version_msg(USR_GVIMRC_FILE3); | |
1128 version_msg("\"\n"); | |
1129 # endif | |
1130 #endif | |
1131 #ifdef FEAT_GUI | |
1132 # ifdef SYS_MENU_FILE | |
1133 version_msg(_(" system menu file: \"")); | |
1134 version_msg(SYS_MENU_FILE); | |
1135 version_msg("\"\n"); | |
1136 # endif | |
1137 #endif | |
1138 #ifdef HAVE_PATHDEF | |
1139 if (*default_vim_dir != NUL) | |
1140 { | |
1141 version_msg(_(" fall-back for $VIM: \"")); | |
1142 version_msg((char *)default_vim_dir); | |
1143 version_msg("\"\n"); | |
1144 } | |
1145 if (*default_vimruntime_dir != NUL) | |
1146 { | |
1147 version_msg(_(" f-b for $VIMRUNTIME: \"")); | |
1148 version_msg((char *)default_vimruntime_dir); | |
1149 version_msg("\"\n"); | |
1150 } | |
1151 version_msg(_("Compilation: ")); | |
1152 version_msg((char *)all_cflags); | |
1153 version_msg("\n"); | |
1154 #ifdef VMS | |
1155 if (*compiler_version != NUL) | |
1156 { | |
1157 version_msg(_("Compiler: ")); | |
1158 version_msg((char *)compiler_version); | |
1159 version_msg("\n"); | |
1160 } | |
1161 #endif | |
1162 version_msg(_("Linking: ")); | |
1163 version_msg((char *)all_lflags); | |
1164 #endif | |
1165 #ifdef DEBUG | |
1166 version_msg("\n"); | |
1167 version_msg(_(" DEBUG BUILD")); | |
1168 #endif | |
1169 } | |
1170 | |
1171 /* | |
1172 * Output a string for the version message. If it's going to wrap, output a | |
1173 * newline, unless the message is too long to fit on the screen anyway. | |
1174 */ | |
1175 static void | |
1176 version_msg(s) | |
1177 char *s; | |
1178 { | |
1179 int len = (int)STRLEN(s); | |
1180 | |
1181 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns | |
1182 && *s != '\n') | |
1183 msg_putchar('\n'); | |
1184 if (!got_int) | |
1185 MSG_PUTS(s); | |
1186 } | |
1187 | |
1188 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr)); | |
1189 | |
1190 /* | |
5126
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1191 * Show the intro message when not editing a file. |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1192 */ |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1193 void |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1194 maybe_intro_message() |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1195 { |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1196 if (bufempty() |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1197 && curbuf->b_fname == NULL |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1198 #ifdef FEAT_WINDOWS |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1199 && firstwin->w_next == NULL |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1200 #endif |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1201 && vim_strchr(p_shm, SHM_INTRO) == NULL) |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1202 intro_message(FALSE); |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1203 } |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1204 |
71859e71b1f9
updated for version 7.3.1306
Bram Moolenaar <bram@vim.org>
parents:
5124
diff
changeset
|
1205 /* |
7 | 1206 * Give an introductory message about Vim. |
1207 * Only used when starting Vim on an empty file, without a file name. | |
1208 * Or with the ":intro" command (for Sven :-). | |
1209 */ | |
1210 void | |
1211 intro_message(colon) | |
1212 int colon; /* TRUE for ":intro" */ | |
1213 { | |
1214 int i; | |
1215 int row; | |
1216 int blanklines; | |
1217 int sponsor; | |
1218 char *p; | |
1219 static char *(lines[]) = | |
1220 { | |
1221 N_("VIM - Vi IMproved"), | |
1222 "", | |
1223 N_("version "), | |
1224 N_("by Bram Moolenaar et al."), | |
1225 #ifdef MODIFIED_BY | |
1226 " ", | |
1227 #endif | |
1228 N_("Vim is open source and freely distributable"), | |
1229 "", | |
1230 N_("Help poor children in Uganda!"), | |
1231 N_("type :help iccf<Enter> for information "), | |
1232 "", | |
1233 N_("type :q<Enter> to exit "), | |
1234 N_("type :help<Enter> or <F1> for on-line help"), | |
26 | 1235 N_("type :help version7<Enter> for version info"), |
7 | 1236 NULL, |
1237 "", | |
1238 N_("Running in Vi compatible mode"), | |
1239 N_("type :set nocp<Enter> for Vim defaults"), | |
1240 N_("type :help cp-default<Enter> for info on this"), | |
1241 }; | |
1242 #ifdef FEAT_GUI | |
1243 static char *(gui_lines[]) = | |
1244 { | |
1245 NULL, | |
1246 NULL, | |
1247 NULL, | |
1248 NULL, | |
1249 #ifdef MODIFIED_BY | |
1250 NULL, | |
1251 #endif | |
1252 NULL, | |
1253 NULL, | |
1254 NULL, | |
1255 N_("menu Help->Orphans for information "), | |
1256 NULL, | |
1257 N_("Running modeless, typed text is inserted"), | |
1258 N_("menu Edit->Global Settings->Toggle Insert Mode "), | |
1259 N_(" for two modes "), | |
1260 NULL, | |
1261 NULL, | |
1262 NULL, | |
1263 N_("menu Edit->Global Settings->Toggle Vi Compatible"), | |
1264 N_(" for Vim defaults "), | |
1265 }; | |
1266 #endif | |
1267 | |
1268 /* blanklines = screen height - # message lines */ | |
1269 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1); | |
1270 if (!p_cp) | |
1271 blanklines += 4; /* add 4 for not showing "Vi compatible" message */ | |
1272 #if defined(WIN3264) && !defined(FEAT_GUI_W32) | |
1273 if (mch_windows95()) | |
1274 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */ | |
1275 #endif | |
1276 | |
1277 #ifdef FEAT_WINDOWS | |
1278 /* Don't overwrite a statusline. Depends on 'cmdheight'. */ | |
1279 if (p_ls > 1) | |
1280 blanklines -= Rows - topframe->fr_height; | |
1281 #endif | |
1282 if (blanklines < 0) | |
1283 blanklines = 0; | |
1284 | |
1285 /* Show the sponsor and register message one out of four times, the Uganda | |
1286 * message two out of four times. */ | |
615 | 1287 sponsor = (int)time(NULL); |
7 | 1288 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0); |
1289 | |
1290 /* start displaying the message lines after half of the blank lines */ | |
1291 row = blanklines / 2; | |
1292 if ((row >= 2 && Columns >= 50) || colon) | |
1293 { | |
1294 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i) | |
1295 { | |
1296 p = lines[i]; | |
1297 #ifdef FEAT_GUI | |
1298 if (p_im && gui.in_use && gui_lines[i] != NULL) | |
1299 p = gui_lines[i]; | |
1300 #endif | |
1301 if (p == NULL) | |
1302 { | |
1303 if (!p_cp) | |
1304 break; | |
1305 continue; | |
1306 } | |
1307 if (sponsor != 0) | |
1308 { | |
1309 if (strstr(p, "children") != NULL) | |
1310 p = sponsor < 0 | |
1311 ? N_("Sponsor Vim development!") | |
1312 : N_("Become a registered Vim user!"); | |
1313 else if (strstr(p, "iccf") != NULL) | |
1314 p = sponsor < 0 | |
1315 ? N_("type :help sponsor<Enter> for information ") | |
1316 : N_("type :help register<Enter> for information "); | |
1317 else if (strstr(p, "Orphans") != NULL) | |
1318 p = N_("menu Help->Sponsor/Register for information "); | |
1319 } | |
1320 if (*p != NUL) | |
1321 do_intro_line(row, (char_u *)_(p), i == 2, 0); | |
1322 ++row; | |
1323 } | |
1324 #if defined(WIN3264) && !defined(FEAT_GUI_W32) | |
1325 if (mch_windows95()) | |
1326 { | |
1327 do_intro_line(++row, | |
1328 (char_u *)_("WARNING: Windows 95/98/ME detected"), | |
1329 FALSE, hl_attr(HLF_E)); | |
1330 do_intro_line(++row, | |
1331 (char_u *)_("type :help windows95<Enter> for info on this"), | |
1332 FALSE, 0); | |
1333 } | |
1334 #endif | |
1335 } | |
1336 | |
1337 /* Make the wait-return message appear just below the text. */ | |
1338 if (colon) | |
1339 msg_row = row; | |
1340 } | |
1341 | |
1342 static void | |
1343 do_intro_line(row, mesg, add_version, attr) | |
1344 int row; | |
1345 char_u *mesg; | |
1346 int add_version; | |
1347 int attr; | |
1348 { | |
1349 char_u vers[20]; | |
1350 int col; | |
1351 char_u *p; | |
1352 int l; | |
1353 int clen; | |
1354 #ifdef MODIFIED_BY | |
1355 # define MODBY_LEN 150 | |
1356 char_u modby[MODBY_LEN]; | |
1357 | |
1358 if (*mesg == ' ') | |
1359 { | |
1491 | 1360 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1); |
7 | 1361 l = STRLEN(modby); |
1491 | 1362 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1); |
7 | 1363 mesg = modby; |
1364 } | |
1365 #endif | |
1366 | |
1367 /* Center the message horizontally. */ | |
1368 col = vim_strsize(mesg); | |
1369 if (add_version) | |
1370 { | |
1371 STRCPY(vers, mediumVersion); | |
1372 if (highest_patch()) | |
1373 { | |
1374 /* Check for 9.9x or 9.9xx, alpha/beta version */ | |
2619 | 1375 if (isalpha((int)vers[3])) |
7 | 1376 { |
3396 | 1377 int len = (isalpha((int)vers[4])) ? 5 : 4; |
1378 sprintf((char *)vers + len, ".%d%s", highest_patch(), | |
1379 mediumVersion + len); | |
7 | 1380 } |
1381 else | |
1382 sprintf((char *)vers + 3, ".%d", highest_patch()); | |
1383 } | |
1384 col += (int)STRLEN(vers); | |
1385 } | |
1386 col = (Columns - col) / 2; | |
1387 if (col < 0) | |
1388 col = 0; | |
1389 | |
1390 /* Split up in parts to highlight <> items differently. */ | |
1391 for (p = mesg; *p != NUL; p += l) | |
1392 { | |
1393 clen = 0; | |
1394 for (l = 0; p[l] != NUL | |
1395 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l) | |
1396 { | |
1397 #ifdef FEAT_MBYTE | |
1398 if (has_mbyte) | |
1399 { | |
1400 clen += ptr2cells(p + l); | |
474 | 1401 l += (*mb_ptr2len)(p + l) - 1; |
7 | 1402 } |
1403 else | |
1404 #endif | |
1405 clen += byte2cells(p[l]); | |
1406 } | |
1407 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr); | |
1408 col += clen; | |
1409 } | |
1410 | |
1411 /* Add the version number to the version line. */ | |
1412 if (add_version) | |
1413 screen_puts(vers, row, col, 0); | |
1414 } | |
1415 | |
1416 /* | |
1417 * ":intro": clear screen, display intro screen and wait for return. | |
1418 */ | |
1419 void | |
1420 ex_intro(eap) | |
1876 | 1421 exarg_T *eap UNUSED; |
7 | 1422 { |
1423 screenclear(); | |
1424 intro_message(TRUE); | |
1425 wait_return(TRUE); | |
1426 } |