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