blob: 652305e74dd3274232b737efb9a9018c68dc0601 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001/* 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 *
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +000020 * Differences between version 6.x and 7.x can be found with ":help version7".
Bram Moolenaar071d4272004-06-13 20:20:40 +000021 * 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
Bram Moolenaard042c562005-06-30 22:04:15 +000030char *Version = VIM_VERSION_SHORT;
31static char *mediumVersion = VIM_VERSION_MEDIUM;
Bram Moolenaar071d4272004-06-13 20:20:40 +000032
33#if defined(HAVE_DATE_TIME) || defined(PROTO)
34# if (defined(VMS) && defined(VAXC)) || defined(PROTO)
35char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
36 + sizeof(__TIME__) + 3];
Bram Moolenaar445f3032013-02-20 16:47:36 +010037
Bram Moolenaar071d4272004-06-13 20:20:40 +000038 void
39make_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
52char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
53# endif
54#else
55char *longVersion = VIM_VERSION_LONG;
56#endif
57
Bram Moolenaarfb97f282013-07-09 17:42:46 +020058static void list_features __ARGS((void));
Bram Moolenaar071d4272004-06-13 20:20:40 +000059static void version_msg __ARGS((char *s));
60
61static 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
Bram Moolenaar860cae12010-06-05 23:22:07 +0200139#ifdef FEAT_CONCEAL
140 "+conceal",
141#else
142 "-conceal",
143#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000144#ifdef FEAT_CRYPT
145 "+cryptv",
146#else
147 "-cryptv",
148#endif
149#ifdef FEAT_CSCOPE
150 "+cscope",
151#else
152 "-cscope",
153#endif
Bram Moolenaar860cae12010-06-05 23:22:07 +0200154#ifdef FEAT_CURSORBIND
155 "+cursorbind",
156#else
157 "-cursorbind",
158#endif
Bram Moolenaar17c7c012006-01-26 22:25:15 +0000159#ifdef CURSOR_SHAPE
160 "+cursorshape",
161#else
162 "-cursorshape",
163#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000164#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
Bram Moolenaar446cb832008-06-24 21:56:24 +0000232#ifdef FEAT_FLOAT
233 "+float",
234#else
235 "-float",
236#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000237#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
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200319#ifdef FEAT_LUA
320# ifdef DYNAMIC_LUA
321 "+lua/dyn",
322# else
323 "+lua",
324# endif
325#else
326 "-lua",
327#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000328#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
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200353
Bram Moolenaar071d4272004-06-13 20:20:40 +0000354#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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000375#endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200376
Bram Moolenaar071d4272004-06-13 20:20:40 +0000377#ifdef __QNX__
378# ifdef FEAT_MOUSE_PTERM
379 "+mouse_pterm",
380# else
381 "-mouse_pterm",
382# endif
383#endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200384
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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000408#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
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000426#ifdef FEAT_MZSCHEME
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000427# ifdef DYNAMIC_MZSCHEME
428 "+mzscheme/dyn",
429# else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000430 "+mzscheme",
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000431# endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000432#else
433 "-mzscheme",
434#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000435#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
Bram Moolenaar071d4272004-06-13 20:20:40 +0000447#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
Bram Moolenaar55debbe2010-05-23 23:34:36 +0200461#ifdef FEAT_PERSISTENT_UNDO
462 "+persistent_undo",
463#else
464 "-persistent_undo",
465#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000466#ifdef FEAT_PRINTER
467# ifdef FEAT_POSTSCRIPT
468 "+postscript",
469# else
470 "-postscript",
471# endif
472 "+printer",
473#else
474 "-printer",
475#endif
Bram Moolenaar05159a02005-02-26 23:04:13 +0000476#ifdef FEAT_PROFILE
477 "+profile",
478#else
479 "-profile",
480#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000481#ifdef FEAT_PYTHON
482# ifdef DYNAMIC_PYTHON
483 "+python/dyn",
484# else
485 "+python",
486# endif
487#else
488 "-python",
489#endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200490#ifdef FEAT_PYTHON3
491# ifdef DYNAMIC_PYTHON3
492 "+python3/dyn",
493# else
494 "+python3",
495# endif
496#else
497 "-python3",
498#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000499#ifdef FEAT_QUICKFIX
500 "+quickfix",
501#else
502 "-quickfix",
503#endif
Bram Moolenaard68071d2006-05-02 22:08:30 +0000504#ifdef FEAT_RELTIME
505 "+reltime",
506#else
507 "-reltime",
508#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000509#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
Bram Moolenaaref94eec2009-11-11 13:22:11 +0000543#ifdef STARTUPTIME
544 "+startuptime",
545#else
546 "-startuptime",
547#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000548#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
728static int included_patches[] =
729{ /* Add new patch number below this line */
730/**/
Bram Moolenaar2b90ed22013-07-24 16:02:36 +0200731 42,
732/**/
Bram Moolenaarad875fb2013-07-24 15:02:03 +0200733 41,
734/**/
Bram Moolenaare24a9c02013-07-24 13:49:22 +0200735 40,
736/**/
Bram Moolenaar196ed142013-07-21 18:59:24 +0200737 39,
738/**/
Bram Moolenaar9d488952013-07-21 17:53:58 +0200739 38,
740/**/
Bram Moolenaar5f919ee2013-07-21 17:46:43 +0200741 37,
742/**/
Bram Moolenaarac7c33e2013-07-21 17:06:00 +0200743 36,
744/**/
Bram Moolenaare53c8612013-07-17 22:35:39 +0200745 35,
746/**/
Bram Moolenaara8f96392013-07-17 21:59:13 +0200747 34,
748/**/
Bram Moolenaarb7a846d2013-07-17 21:40:31 +0200749 33,
750/**/
Bram Moolenaar69b52452013-07-17 21:10:51 +0200751 32,
752/**/
Bram Moolenaarde9149e2013-07-17 19:22:13 +0200753 31,
754/**/
Bram Moolenaar4a3aef72013-07-17 19:12:57 +0200755 30,
756/**/
Bram Moolenaar9e902192013-07-17 18:58:11 +0200757 29,
758/**/
Bram Moolenaar706d2de2013-07-17 17:35:13 +0200759 28,
760/**/
Bram Moolenaar95064ec2013-07-17 17:15:25 +0200761 27,
762/**/
Bram Moolenaar33ca6bf2013-07-17 13:43:39 +0200763 26,
764/**/
Bram Moolenaar56667a52013-07-17 11:54:28 +0200765 25,
766/**/
Bram Moolenaar6f292662013-07-14 15:06:50 +0200767 24,
768/**/
Bram Moolenaar6f394f82013-07-14 13:41:56 +0200769 23,
770/**/
Bram Moolenaar91b2bdb2013-07-14 13:32:15 +0200771 22,
772/**/
Bram Moolenaarff525182013-07-14 13:02:12 +0200773 21,
774/**/
Bram Moolenaar3fb14bc2013-07-14 12:34:56 +0200775 20,
776/**/
Bram Moolenaaree31be62013-07-14 12:21:57 +0200777 19,
778/**/
Bram Moolenaar690ae9c2013-07-13 20:58:11 +0200779 18,
780/**/
Bram Moolenaar2b79bfd2013-07-13 16:34:32 +0200781 17,
782/**/
Bram Moolenaara0aa9072013-07-13 15:39:33 +0200783 16,
784/**/
Bram Moolenaara3fe8fe2013-07-13 15:33:20 +0200785 15,
786/**/
Bram Moolenaar8e46f722013-07-13 14:08:16 +0200787 14,
788/**/
Bram Moolenaar3ff9b182013-07-13 12:36:55 +0200789 13,
790/**/
Bram Moolenaarfba24242013-07-12 20:16:58 +0200791 12,
792/**/
Bram Moolenaarfee496d2013-07-12 20:07:24 +0200793 11,
794/**/
Bram Moolenaare741f272013-07-09 21:57:52 +0200795 10,
796/**/
Bram Moolenaarfb97f282013-07-09 17:42:46 +0200797 9,
798/**/
Bram Moolenaare0324612013-07-09 17:30:55 +0200799 8,
800/**/
Bram Moolenaarb69510e2013-07-09 17:08:29 +0200801 7,
802/**/
Bram Moolenaar4ca8d5f2013-07-09 14:58:10 +0200803 6,
804/**/
Bram Moolenaar04c5c9e2013-07-09 13:44:59 +0200805 5,
806/**/
Bram Moolenaarc64b85a2013-07-09 13:15:46 +0200807 4,
808/**/
Bram Moolenaarf4c096b2013-07-09 12:54:21 +0200809 3,
810/**/
Bram Moolenaare8785f22013-07-07 16:15:35 +0200811 2,
812/**/
Bram Moolenaar7b8c2682013-07-06 16:23:02 +0200813 1,
814/**/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000815 0
816};
817
Bram Moolenaar10d4cec2008-11-30 11:15:09 +0000818/*
819 * Place to put a short description when adding a feature with a patch.
820 * Keep it short, e.g.,: "relative numbers", "persistent undo".
821 * Also add a comment marker to separate the lines.
822 * See the official Vim patches for the diff format: It must use a context of
Bram Moolenaarcbb8eb32008-12-24 13:25:14 +0000823 * one line only. Create it by hand or use "diff -C2" and edit the patch.
Bram Moolenaar10d4cec2008-11-30 11:15:09 +0000824 */
825static char *(extra_patches[]) =
826{ /* Add your patch description below this line */
827/**/
828 NULL
829};
830
Bram Moolenaar071d4272004-06-13 20:20:40 +0000831 int
832highest_patch()
833{
834 int i;
835 int h = 0;
836
837 for (i = 0; included_patches[i] != 0; ++i)
838 if (included_patches[i] > h)
839 h = included_patches[i];
840 return h;
841}
842
843#if defined(FEAT_EVAL) || defined(PROTO)
844/*
845 * Return TRUE if patch "n" has been included.
846 */
847 int
848has_patch(n)
849 int n;
850{
851 int i;
852
853 for (i = 0; included_patches[i] != 0; ++i)
854 if (included_patches[i] == n)
855 return TRUE;
856 return FALSE;
857}
858#endif
859
860 void
861ex_version(eap)
862 exarg_T *eap;
863{
864 /*
865 * Ignore a ":version 9.99" command.
866 */
867 if (*eap->arg == NUL)
868 {
869 msg_putchar('\n');
870 list_version();
871 }
872}
873
Bram Moolenaar445f3032013-02-20 16:47:36 +0100874/*
875 * List all features aligned in columns, dictionary style.
876 */
877 static void
878list_features()
879{
880 int i;
881 int ncol;
882 int nrow;
883 int nfeat = 0;
884 int width = 0;
885
886 /* Find the length of the longest feature name, use that + 1 as the column
887 * width */
888 for (i = 0; features[i] != NULL; ++i)
889 {
Bram Moolenaar5c962632013-02-26 11:25:33 +0100890 int l = (int)STRLEN(features[i]);
Bram Moolenaar445f3032013-02-20 16:47:36 +0100891
892 if (l > width)
893 width = l;
894 ++nfeat;
895 }
896 width += 1;
897
898 if (Columns < width)
899 {
900 /* Not enough screen columns - show one per line */
901 for (i = 0; features[i] != NULL; ++i)
902 {
903 version_msg(features[i]);
904 if (msg_col > 0)
905 msg_putchar('\n');
906 }
907 return;
908 }
909
Bram Moolenaar445f3032013-02-20 16:47:36 +0100910 /* The rightmost column doesn't need a separator.
911 * Sacrifice it to fit in one more column if possible. */
Bram Moolenaarf13f45d2013-02-26 15:27:23 +0100912 ncol = (int) (Columns + 1) / width;
Bram Moolenaar445f3032013-02-20 16:47:36 +0100913 nrow = nfeat / ncol + (nfeat % ncol ? 1 : 0);
914
Bram Moolenaarf13f45d2013-02-26 15:27:23 +0100915 /* i counts columns then rows. idx counts rows then columns. */
Bram Moolenaar445f3032013-02-20 16:47:36 +0100916 for (i = 0; !got_int && i < nrow * ncol; ++i)
917 {
918 int idx = (i / ncol) + (i % ncol) * nrow;
919
920 if (idx < nfeat)
921 {
922 int last_col = (i + 1) % ncol == 0;
923
924 msg_puts((char_u *)features[idx]);
925 if (last_col)
926 {
927 if (msg_col > 0)
928 msg_putchar('\n');
929 }
930 else
931 {
932 while (msg_col % width)
933 msg_putchar(' ');
934 }
935 }
936 else
Bram Moolenaarf13f45d2013-02-26 15:27:23 +0100937 {
938 if (msg_col > 0)
939 msg_putchar('\n');
940 }
Bram Moolenaar445f3032013-02-20 16:47:36 +0100941 }
942}
Bram Moolenaar5c962632013-02-26 11:25:33 +0100943
Bram Moolenaar071d4272004-06-13 20:20:40 +0000944 void
945list_version()
946{
947 int i;
948 int first;
949 char *s = "";
950
951 /*
952 * When adding features here, don't forget to update the list of
953 * internal variables in eval.c!
954 */
955 MSG(longVersion);
956#ifdef WIN3264
957# ifdef FEAT_GUI_W32
958# if defined(_MSC_VER) && (_MSC_VER <= 1010)
959 /* Only MS VC 4.1 and earlier can do Win32s */
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000960 MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
Bram Moolenaar071d4272004-06-13 20:20:40 +0000961# else
Bram Moolenaard9b87332006-10-03 14:30:41 +0000962# ifdef _WIN64
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000963 MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
Bram Moolenaard9b87332006-10-03 14:30:41 +0000964# else
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000965 MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
Bram Moolenaard9b87332006-10-03 14:30:41 +0000966# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000967# endif
968 if (gui_is_win32s())
969 MSG_PUTS(_(" in Win32s mode"));
970# ifdef FEAT_OLE
971 MSG_PUTS(_(" with OLE support"));
972# endif
973# else
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000974# ifdef _WIN64
975 MSG_PUTS(_("\nMS-Windows 64-bit console version"));
976# else
977 MSG_PUTS(_("\nMS-Windows 32-bit console version"));
978# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000979# endif
980#endif
981#ifdef WIN16
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000982 MSG_PUTS(_("\nMS-Windows 16-bit version"));
Bram Moolenaar071d4272004-06-13 20:20:40 +0000983#endif
984#ifdef MSDOS
985# ifdef DJGPP
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000986 MSG_PUTS(_("\n32-bit MS-DOS version"));
Bram Moolenaar071d4272004-06-13 20:20:40 +0000987# else
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +0000988 MSG_PUTS(_("\n16-bit MS-DOS version"));
Bram Moolenaar071d4272004-06-13 20:20:40 +0000989# endif
990#endif
991#ifdef MACOS
992# ifdef MACOS_X
993# ifdef MACOS_X_UNIX
994 MSG_PUTS(_("\nMacOS X (unix) version"));
995# else
996 MSG_PUTS(_("\nMacOS X version"));
997# endif
998#else
999 MSG_PUTS(_("\nMacOS version"));
1000# endif
1001#endif
1002
Bram Moolenaar071d4272004-06-13 20:20:40 +00001003#ifdef VMS
Bram Moolenaar6949d1d2008-08-25 02:14:05 +00001004 MSG_PUTS(_("\nOpenVMS version"));
Bram Moolenaar3d20ca12006-11-28 16:43:58 +00001005# ifdef HAVE_PATHDEF
1006 if (*compiled_arch != NUL)
1007 {
1008 MSG_PUTS(" - ");
1009 MSG_PUTS(compiled_arch);
1010 }
1011# endif
1012
Bram Moolenaar071d4272004-06-13 20:20:40 +00001013#endif
1014
1015 /* Print the list of patch numbers if there is at least one. */
1016 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1017 if (included_patches[0] != 0)
1018 {
1019 MSG_PUTS(_("\nIncluded patches: "));
1020 first = -1;
1021 /* find last one */
1022 for (i = 0; included_patches[i] != 0; ++i)
1023 ;
1024 while (--i >= 0)
1025 {
1026 if (first < 0)
1027 first = included_patches[i];
1028 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1029 {
1030 MSG_PUTS(s);
1031 s = ", ";
1032 msg_outnum((long)first);
1033 if (first != included_patches[i])
1034 {
1035 MSG_PUTS("-");
1036 msg_outnum((long)included_patches[i]);
1037 }
1038 first = -1;
1039 }
1040 }
1041 }
1042
Bram Moolenaar10d4cec2008-11-30 11:15:09 +00001043 /* Print the list of extra patch descriptions if there is at least one. */
1044 if (extra_patches[0] != NULL)
1045 {
1046 MSG_PUTS(_("\nExtra patches: "));
1047 s = "";
1048 for (i = 0; extra_patches[i] != NULL; ++i)
1049 {
1050 MSG_PUTS(s);
1051 s = ", ";
1052 MSG_PUTS(extra_patches[i]);
1053 }
1054 }
1055
Bram Moolenaar071d4272004-06-13 20:20:40 +00001056#ifdef MODIFIED_BY
1057 MSG_PUTS("\n");
1058 MSG_PUTS(_("Modified by "));
1059 MSG_PUTS(MODIFIED_BY);
1060#endif
1061
1062#ifdef HAVE_PATHDEF
1063 if (*compiled_user != NUL || *compiled_sys != NUL)
1064 {
1065 MSG_PUTS(_("\nCompiled "));
1066 if (*compiled_user != NUL)
1067 {
1068 MSG_PUTS(_("by "));
1069 MSG_PUTS(compiled_user);
1070 }
1071 if (*compiled_sys != NUL)
1072 {
1073 MSG_PUTS("@");
1074 MSG_PUTS(compiled_sys);
1075 }
1076 }
1077#endif
1078
1079#ifdef FEAT_HUGE
1080 MSG_PUTS(_("\nHuge version "));
1081#else
1082# ifdef FEAT_BIG
1083 MSG_PUTS(_("\nBig version "));
1084# else
1085# ifdef FEAT_NORMAL
1086 MSG_PUTS(_("\nNormal version "));
1087# else
1088# ifdef FEAT_SMALL
1089 MSG_PUTS(_("\nSmall version "));
1090# else
1091 MSG_PUTS(_("\nTiny version "));
1092# endif
1093# endif
1094# endif
1095#endif
1096#ifndef FEAT_GUI
1097 MSG_PUTS(_("without GUI."));
1098#else
1099# ifdef FEAT_GUI_GTK
1100# ifdef FEAT_GUI_GNOME
Bram Moolenaar071d4272004-06-13 20:20:40 +00001101 MSG_PUTS(_("with GTK2-GNOME GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001102# else
Bram Moolenaar071d4272004-06-13 20:20:40 +00001103 MSG_PUTS(_("with GTK2 GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001104# endif
1105# else
1106# ifdef FEAT_GUI_MOTIF
1107 MSG_PUTS(_("with X11-Motif GUI."));
1108# else
1109# ifdef FEAT_GUI_ATHENA
1110# ifdef FEAT_GUI_NEXTAW
1111 MSG_PUTS(_("with X11-neXtaw GUI."));
1112# else
1113 MSG_PUTS(_("with X11-Athena GUI."));
1114# endif
1115# else
Bram Moolenaar071d4272004-06-13 20:20:40 +00001116# ifdef FEAT_GUI_PHOTON
1117 MSG_PUTS(_("with Photon GUI."));
1118# else
1119# if defined(MSWIN)
1120 MSG_PUTS(_("with GUI."));
1121# else
Bram Moolenaar860cae12010-06-05 23:22:07 +02001122# if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
Bram Moolenaar071d4272004-06-13 20:20:40 +00001123 MSG_PUTS(_("with Carbon GUI."));
1124# else
Bram Moolenaar860cae12010-06-05 23:22:07 +02001125# if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
Bram Moolenaar071d4272004-06-13 20:20:40 +00001126 MSG_PUTS(_("with Cocoa GUI."));
1127# else
Bram Moolenaar860cae12010-06-05 23:22:07 +02001128# if defined(MACOS)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001129 MSG_PUTS(_("with (classic) GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001130# endif
1131# endif
1132# endif
1133# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001134# endif
1135# endif
1136# endif
1137# endif
1138#endif
1139 version_msg(_(" Features included (+) or not (-):\n"));
1140
Bram Moolenaar445f3032013-02-20 16:47:36 +01001141 list_features();
Bram Moolenaar071d4272004-06-13 20:20:40 +00001142
Bram Moolenaar071d4272004-06-13 20:20:40 +00001143#ifdef SYS_VIMRC_FILE
1144 version_msg(_(" system vimrc file: \""));
1145 version_msg(SYS_VIMRC_FILE);
1146 version_msg("\"\n");
1147#endif
1148#ifdef USR_VIMRC_FILE
1149 version_msg(_(" user vimrc file: \""));
1150 version_msg(USR_VIMRC_FILE);
1151 version_msg("\"\n");
1152#endif
1153#ifdef USR_VIMRC_FILE2
1154 version_msg(_(" 2nd user vimrc file: \""));
1155 version_msg(USR_VIMRC_FILE2);
1156 version_msg("\"\n");
1157#endif
1158#ifdef USR_VIMRC_FILE3
1159 version_msg(_(" 3rd user vimrc file: \""));
1160 version_msg(USR_VIMRC_FILE3);
1161 version_msg("\"\n");
1162#endif
1163#ifdef USR_EXRC_FILE
1164 version_msg(_(" user exrc file: \""));
1165 version_msg(USR_EXRC_FILE);
1166 version_msg("\"\n");
1167#endif
1168#ifdef USR_EXRC_FILE2
1169 version_msg(_(" 2nd user exrc file: \""));
1170 version_msg(USR_EXRC_FILE2);
1171 version_msg("\"\n");
1172#endif
1173#ifdef FEAT_GUI
1174# ifdef SYS_GVIMRC_FILE
1175 version_msg(_(" system gvimrc file: \""));
1176 version_msg(SYS_GVIMRC_FILE);
1177 version_msg("\"\n");
1178# endif
1179 version_msg(_(" user gvimrc file: \""));
1180 version_msg(USR_GVIMRC_FILE);
1181 version_msg("\"\n");
1182# ifdef USR_GVIMRC_FILE2
1183 version_msg(_("2nd user gvimrc file: \""));
1184 version_msg(USR_GVIMRC_FILE2);
1185 version_msg("\"\n");
1186# endif
1187# ifdef USR_GVIMRC_FILE3
1188 version_msg(_("3rd user gvimrc file: \""));
1189 version_msg(USR_GVIMRC_FILE3);
1190 version_msg("\"\n");
1191# endif
1192#endif
1193#ifdef FEAT_GUI
1194# ifdef SYS_MENU_FILE
1195 version_msg(_(" system menu file: \""));
1196 version_msg(SYS_MENU_FILE);
1197 version_msg("\"\n");
1198# endif
1199#endif
1200#ifdef HAVE_PATHDEF
1201 if (*default_vim_dir != NUL)
1202 {
1203 version_msg(_(" fall-back for $VIM: \""));
1204 version_msg((char *)default_vim_dir);
1205 version_msg("\"\n");
1206 }
1207 if (*default_vimruntime_dir != NUL)
1208 {
1209 version_msg(_(" f-b for $VIMRUNTIME: \""));
1210 version_msg((char *)default_vimruntime_dir);
1211 version_msg("\"\n");
1212 }
1213 version_msg(_("Compilation: "));
1214 version_msg((char *)all_cflags);
1215 version_msg("\n");
1216#ifdef VMS
1217 if (*compiler_version != NUL)
1218 {
1219 version_msg(_("Compiler: "));
1220 version_msg((char *)compiler_version);
1221 version_msg("\n");
1222 }
1223#endif
1224 version_msg(_("Linking: "));
1225 version_msg((char *)all_lflags);
1226#endif
1227#ifdef DEBUG
1228 version_msg("\n");
1229 version_msg(_(" DEBUG BUILD"));
1230#endif
1231}
1232
1233/*
1234 * Output a string for the version message. If it's going to wrap, output a
1235 * newline, unless the message is too long to fit on the screen anyway.
1236 */
1237 static void
1238version_msg(s)
1239 char *s;
1240{
1241 int len = (int)STRLEN(s);
1242
1243 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1244 && *s != '\n')
1245 msg_putchar('\n');
1246 if (!got_int)
1247 MSG_PUTS(s);
1248}
1249
1250static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1251
1252/*
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001253 * Show the intro message when not editing a file.
1254 */
1255 void
1256maybe_intro_message()
1257{
1258 if (bufempty()
1259 && curbuf->b_fname == NULL
1260#ifdef FEAT_WINDOWS
1261 && firstwin->w_next == NULL
1262#endif
1263 && vim_strchr(p_shm, SHM_INTRO) == NULL)
1264 intro_message(FALSE);
1265}
1266
1267/*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001268 * Give an introductory message about Vim.
1269 * Only used when starting Vim on an empty file, without a file name.
1270 * Or with the ":intro" command (for Sven :-).
1271 */
1272 void
1273intro_message(colon)
1274 int colon; /* TRUE for ":intro" */
1275{
1276 int i;
1277 int row;
1278 int blanklines;
1279 int sponsor;
1280 char *p;
1281 static char *(lines[]) =
1282 {
1283 N_("VIM - Vi IMproved"),
1284 "",
1285 N_("version "),
1286 N_("by Bram Moolenaar et al."),
1287#ifdef MODIFIED_BY
1288 " ",
1289#endif
1290 N_("Vim is open source and freely distributable"),
1291 "",
1292 N_("Help poor children in Uganda!"),
1293 N_("type :help iccf<Enter> for information "),
1294 "",
1295 N_("type :q<Enter> to exit "),
1296 N_("type :help<Enter> or <F1> for on-line help"),
Bram Moolenaar3fdfa4a2004-10-07 21:02:47 +00001297 N_("type :help version7<Enter> for version info"),
Bram Moolenaar071d4272004-06-13 20:20:40 +00001298 NULL,
1299 "",
1300 N_("Running in Vi compatible mode"),
1301 N_("type :set nocp<Enter> for Vim defaults"),
1302 N_("type :help cp-default<Enter> for info on this"),
1303 };
1304#ifdef FEAT_GUI
1305 static char *(gui_lines[]) =
1306 {
1307 NULL,
1308 NULL,
1309 NULL,
1310 NULL,
1311#ifdef MODIFIED_BY
1312 NULL,
1313#endif
1314 NULL,
1315 NULL,
1316 NULL,
1317 N_("menu Help->Orphans for information "),
1318 NULL,
1319 N_("Running modeless, typed text is inserted"),
1320 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1321 N_(" for two modes "),
1322 NULL,
1323 NULL,
1324 NULL,
1325 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1326 N_(" for Vim defaults "),
1327 };
1328#endif
1329
1330 /* blanklines = screen height - # message lines */
1331 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1332 if (!p_cp)
1333 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1334#if defined(WIN3264) && !defined(FEAT_GUI_W32)
1335 if (mch_windows95())
1336 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1337#endif
1338
1339#ifdef FEAT_WINDOWS
1340 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1341 if (p_ls > 1)
1342 blanklines -= Rows - topframe->fr_height;
1343#endif
1344 if (blanklines < 0)
1345 blanklines = 0;
1346
1347 /* Show the sponsor and register message one out of four times, the Uganda
1348 * message two out of four times. */
Bram Moolenaarf4cd3e82005-12-22 22:47:02 +00001349 sponsor = (int)time(NULL);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001350 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1351
1352 /* start displaying the message lines after half of the blank lines */
1353 row = blanklines / 2;
1354 if ((row >= 2 && Columns >= 50) || colon)
1355 {
1356 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1357 {
1358 p = lines[i];
1359#ifdef FEAT_GUI
1360 if (p_im && gui.in_use && gui_lines[i] != NULL)
1361 p = gui_lines[i];
1362#endif
1363 if (p == NULL)
1364 {
1365 if (!p_cp)
1366 break;
1367 continue;
1368 }
1369 if (sponsor != 0)
1370 {
1371 if (strstr(p, "children") != NULL)
1372 p = sponsor < 0
1373 ? N_("Sponsor Vim development!")
1374 : N_("Become a registered Vim user!");
1375 else if (strstr(p, "iccf") != NULL)
1376 p = sponsor < 0
1377 ? N_("type :help sponsor<Enter> for information ")
1378 : N_("type :help register<Enter> for information ");
1379 else if (strstr(p, "Orphans") != NULL)
1380 p = N_("menu Help->Sponsor/Register for information ");
1381 }
1382 if (*p != NUL)
1383 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1384 ++row;
1385 }
1386#if defined(WIN3264) && !defined(FEAT_GUI_W32)
1387 if (mch_windows95())
1388 {
1389 do_intro_line(++row,
1390 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1391 FALSE, hl_attr(HLF_E));
1392 do_intro_line(++row,
1393 (char_u *)_("type :help windows95<Enter> for info on this"),
1394 FALSE, 0);
1395 }
1396#endif
1397 }
1398
1399 /* Make the wait-return message appear just below the text. */
1400 if (colon)
1401 msg_row = row;
1402}
1403
1404 static void
1405do_intro_line(row, mesg, add_version, attr)
1406 int row;
1407 char_u *mesg;
1408 int add_version;
1409 int attr;
1410{
1411 char_u vers[20];
1412 int col;
1413 char_u *p;
1414 int l;
1415 int clen;
1416#ifdef MODIFIED_BY
1417# define MODBY_LEN 150
1418 char_u modby[MODBY_LEN];
1419
1420 if (*mesg == ' ')
1421 {
Bram Moolenaar589e43a2008-01-05 12:59:22 +00001422 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001423 l = STRLEN(modby);
Bram Moolenaar589e43a2008-01-05 12:59:22 +00001424 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001425 mesg = modby;
1426 }
1427#endif
1428
1429 /* Center the message horizontally. */
1430 col = vim_strsize(mesg);
1431 if (add_version)
1432 {
1433 STRCPY(vers, mediumVersion);
1434 if (highest_patch())
1435 {
1436 /* Check for 9.9x or 9.9xx, alpha/beta version */
Bram Moolenaar22df3f92010-10-27 16:01:27 +02001437 if (isalpha((int)vers[3]))
Bram Moolenaar071d4272004-06-13 20:20:40 +00001438 {
Bram Moolenaar552ac132012-03-07 18:03:10 +01001439 int len = (isalpha((int)vers[4])) ? 5 : 4;
1440 sprintf((char *)vers + len, ".%d%s", highest_patch(),
1441 mediumVersion + len);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001442 }
1443 else
1444 sprintf((char *)vers + 3, ".%d", highest_patch());
1445 }
1446 col += (int)STRLEN(vers);
1447 }
1448 col = (Columns - col) / 2;
1449 if (col < 0)
1450 col = 0;
1451
1452 /* Split up in parts to highlight <> items differently. */
1453 for (p = mesg; *p != NUL; p += l)
1454 {
1455 clen = 0;
1456 for (l = 0; p[l] != NUL
1457 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1458 {
1459#ifdef FEAT_MBYTE
1460 if (has_mbyte)
1461 {
1462 clen += ptr2cells(p + l);
Bram Moolenaar0fa313a2005-08-10 21:07:57 +00001463 l += (*mb_ptr2len)(p + l) - 1;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001464 }
1465 else
1466#endif
1467 clen += byte2cells(p[l]);
1468 }
1469 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1470 col += clen;
1471 }
1472
1473 /* Add the version number to the version line. */
1474 if (add_version)
1475 screen_puts(vers, row, col, 0);
1476}
1477
1478/*
1479 * ":intro": clear screen, display intro screen and wait for return.
1480 */
Bram Moolenaar071d4272004-06-13 20:20:40 +00001481 void
1482ex_intro(eap)
Bram Moolenaar0c094b92009-05-14 20:20:33 +00001483 exarg_T *eap UNUSED;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001484{
1485 screenclear();
1486 intro_message(TRUE);
1487 wait_return(TRUE);
1488}