xref: /vim-8.2.3635/src/version.c (revision 81ea1dfb)
1 /* vi:set ts=8 sts=4 sw=4 noet:
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  *
20  * Differences between version 7.4 and 8.x can be found with ":help version8".
21  * Differences between version 6.4 and 7.x can be found with ":help version7".
22  * Differences between version 5.8 and 6.x can be found with ":help version6".
23  * Differences between version 4.x and 5.x can be found with ":help version5".
24  * Differences between version 3.0 and 4.x can be found with ":help version4".
25  * All the remarks about older versions have been removed, they are not very
26  * interesting.
27  */
28 
29 #include "version.h"
30 
31 char		*Version = VIM_VERSION_SHORT;
32 static char	*mediumVersion = VIM_VERSION_MEDIUM;
33 
34 #if defined(HAVE_DATE_TIME) || defined(PROTO)
35 # if (defined(VMS) && defined(VAXC)) || defined(PROTO)
36 char	longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
37 						      + sizeof(__TIME__) + 3];
38 
39     void
40 init_longVersion(void)
41 {
42     /*
43      * Construct the long version string.  Necessary because
44      * VAX C can't concatenate strings in the preprocessor.
45      */
46     strcpy(longVersion, VIM_VERSION_LONG_DATE);
47     strcat(longVersion, __DATE__);
48     strcat(longVersion, " ");
49     strcat(longVersion, __TIME__);
50     strcat(longVersion, ")");
51 }
52 
53 # else
54     void
55 init_longVersion(void)
56 {
57     char *date_time = __DATE__ " " __TIME__;
58     char *msg = _("%s (%s, compiled %s)");
59     size_t len = strlen(msg)
60 		+ strlen(VIM_VERSION_LONG_ONLY)
61 		+ strlen(VIM_VERSION_DATE_ONLY)
62 		+ strlen(date_time);
63 
64     longVersion = alloc(len);
65     if (longVersion == NULL)
66 	longVersion = VIM_VERSION_LONG;
67     else
68 	vim_snprintf(longVersion, len, msg,
69 		      VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
70 }
71 # endif
72 #else
73 char	*longVersion = VIM_VERSION_LONG;
74 
75     void
76 init_longVersion(void)
77 {
78     // nothing to do
79 }
80 #endif
81 
82 static char *(features[]) =
83 {
84 #ifdef HAVE_ACL
85 	"+acl",
86 #else
87 	"-acl",
88 #endif
89 #ifdef AMIGA		// only for Amiga systems
90 # ifdef FEAT_ARP
91 	"+ARP",
92 # else
93 	"-ARP",
94 # endif
95 #endif
96 #ifdef FEAT_ARABIC
97 	"+arabic",
98 #else
99 	"-arabic",
100 #endif
101 	"+autocmd",
102 #ifdef FEAT_AUTOCHDIR
103        "+autochdir",
104 #else
105        "-autochdir",
106 #endif
107 #ifdef FEAT_AUTOSERVERNAME
108 	"+autoservername",
109 #else
110 	"-autoservername",
111 #endif
112 #ifdef FEAT_BEVAL_GUI
113 	"+balloon_eval",
114 #else
115 	"-balloon_eval",
116 #endif
117 #ifdef FEAT_BEVAL_TERM
118 	"+balloon_eval_term",
119 #else
120 	"-balloon_eval_term",
121 #endif
122 #ifdef FEAT_BROWSE
123 	"+browse",
124 #else
125 	"-browse",
126 #endif
127 #ifdef NO_BUILTIN_TCAPS
128 	"-builtin_terms",
129 #endif
130 #ifdef SOME_BUILTIN_TCAPS
131 	"+builtin_terms",
132 #endif
133 #ifdef ALL_BUILTIN_TCAPS
134 	"++builtin_terms",
135 #endif
136 #ifdef FEAT_BYTEOFF
137 	"+byte_offset",
138 #else
139 	"-byte_offset",
140 #endif
141 #ifdef FEAT_JOB_CHANNEL
142 	"+channel",
143 #else
144 	"-channel",
145 #endif
146 #ifdef FEAT_CINDENT
147 	"+cindent",
148 #else
149 	"-cindent",
150 #endif
151 #ifdef FEAT_CLIENTSERVER
152 	"+clientserver",
153 #else
154 	"-clientserver",
155 #endif
156 #ifdef FEAT_CLIPBOARD
157 	"+clipboard",
158 #else
159 	"-clipboard",
160 #endif
161 	"+cmdline_compl",
162 	"+cmdline_hist",
163 #ifdef FEAT_CMDL_INFO
164 	"+cmdline_info",
165 #else
166 	"-cmdline_info",
167 #endif
168 	"+comments",
169 #ifdef FEAT_CONCEAL
170 	"+conceal",
171 #else
172 	"-conceal",
173 #endif
174 #ifdef FEAT_CRYPT
175 	"+cryptv",
176 #else
177 	"-cryptv",
178 #endif
179 #ifdef FEAT_CSCOPE
180 	"+cscope",
181 #else
182 	"-cscope",
183 #endif
184 	"+cursorbind",
185 #ifdef CURSOR_SHAPE
186 	"+cursorshape",
187 #else
188 	"-cursorshape",
189 #endif
190 #if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
191 	"+dialog_con_gui",
192 #else
193 # if defined(FEAT_CON_DIALOG)
194 	"+dialog_con",
195 # else
196 #  if defined(FEAT_GUI_DIALOG)
197 	"+dialog_gui",
198 #  else
199 	"-dialog",
200 #  endif
201 # endif
202 #endif
203 #ifdef FEAT_DIFF
204 	"+diff",
205 #else
206 	"-diff",
207 #endif
208 #ifdef FEAT_DIGRAPHS
209 	"+digraphs",
210 #else
211 	"-digraphs",
212 #endif
213 #ifdef FEAT_GUI_MSWIN
214 # ifdef FEAT_DIRECTX
215 	"+directx",
216 # else
217 	"-directx",
218 # endif
219 #endif
220 #ifdef FEAT_DND
221 	"+dnd",
222 #else
223 	"-dnd",
224 #endif
225 #ifdef EBCDIC
226 	"+ebcdic",
227 #else
228 	"-ebcdic",
229 #endif
230 #ifdef FEAT_EMACS_TAGS
231 	"+emacs_tags",
232 #else
233 	"-emacs_tags",
234 #endif
235 #ifdef FEAT_EVAL
236 	"+eval",
237 #else
238 	"-eval",
239 #endif
240 	"+ex_extra",
241 #ifdef FEAT_SEARCH_EXTRA
242 	"+extra_search",
243 #else
244 	"-extra_search",
245 #endif
246 	"-farsi",
247 #ifdef FEAT_SEARCHPATH
248 	"+file_in_path",
249 #else
250 	"-file_in_path",
251 #endif
252 #ifdef FEAT_FIND_ID
253 	"+find_in_path",
254 #else
255 	"-find_in_path",
256 #endif
257 #ifdef FEAT_FLOAT
258 	"+float",
259 #else
260 	"-float",
261 #endif
262 #ifdef FEAT_FOLDING
263 	"+folding",
264 #else
265 	"-folding",
266 #endif
267 #ifdef FEAT_FOOTER
268 	"+footer",
269 #else
270 	"-footer",
271 #endif
272 	    // only interesting on Unix systems
273 #if !defined(USE_SYSTEM) && defined(UNIX)
274 	"+fork()",
275 #endif
276 #ifdef FEAT_GETTEXT
277 # ifdef DYNAMIC_GETTEXT
278 	"+gettext/dyn",
279 # else
280 	"+gettext",
281 # endif
282 #else
283 	"-gettext",
284 #endif
285 	"-hangul_input",
286 #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
287 # ifdef DYNAMIC_ICONV
288 	"+iconv/dyn",
289 # else
290 	"+iconv",
291 # endif
292 #else
293 	"-iconv",
294 #endif
295 	"+insert_expand",
296 #ifdef FEAT_JOB_CHANNEL
297 	"+job",
298 #else
299 	"-job",
300 #endif
301 #ifdef FEAT_JUMPLIST
302 	"+jumplist",
303 #else
304 	"-jumplist",
305 #endif
306 #ifdef FEAT_KEYMAP
307 	"+keymap",
308 #else
309 	"-keymap",
310 #endif
311 #ifdef FEAT_EVAL
312 	"+lambda",
313 #else
314 	"-lambda",
315 #endif
316 #ifdef FEAT_LANGMAP
317 	"+langmap",
318 #else
319 	"-langmap",
320 #endif
321 #ifdef FEAT_LIBCALL
322 	"+libcall",
323 #else
324 	"-libcall",
325 #endif
326 #ifdef FEAT_LINEBREAK
327 	"+linebreak",
328 #else
329 	"-linebreak",
330 #endif
331 #ifdef FEAT_LISP
332 	"+lispindent",
333 #else
334 	"-lispindent",
335 #endif
336 	"+listcmds",
337 	"+localmap",
338 #ifdef FEAT_LUA
339 # ifdef DYNAMIC_LUA
340 	"+lua/dyn",
341 # else
342 	"+lua",
343 # endif
344 #else
345 	"-lua",
346 #endif
347 #ifdef FEAT_MENU
348 	"+menu",
349 #else
350 	"-menu",
351 #endif
352 #ifdef FEAT_SESSION
353 	"+mksession",
354 #else
355 	"-mksession",
356 #endif
357 	"+modify_fname",
358 	"+mouse",
359 #ifdef FEAT_MOUSESHAPE
360 	"+mouseshape",
361 #else
362 	"-mouseshape",
363 #endif
364 
365 #if defined(UNIX) || defined(VMS)
366 # ifdef FEAT_MOUSE_DEC
367 	"+mouse_dec",
368 # else
369 	"-mouse_dec",
370 # endif
371 # ifdef FEAT_MOUSE_GPM
372 	"+mouse_gpm",
373 # else
374 	"-mouse_gpm",
375 # endif
376 # ifdef FEAT_MOUSE_JSB
377 	"+mouse_jsbterm",
378 # else
379 	"-mouse_jsbterm",
380 # endif
381 # ifdef FEAT_MOUSE_NET
382 	"+mouse_netterm",
383 # else
384 	"-mouse_netterm",
385 # endif
386 #endif
387 
388 #ifdef __QNX__
389 # ifdef FEAT_MOUSE_PTERM
390 	"+mouse_pterm",
391 # else
392 	"-mouse_pterm",
393 # endif
394 #endif
395 
396 #if defined(UNIX) || defined(VMS)
397 	"+mouse_sgr",
398 # ifdef FEAT_SYSMOUSE
399 	"+mouse_sysmouse",
400 # else
401 	"-mouse_sysmouse",
402 # endif
403 # ifdef FEAT_MOUSE_URXVT
404 	"+mouse_urxvt",
405 # else
406 	"-mouse_urxvt",
407 # endif
408 	"+mouse_xterm",
409 #endif
410 
411 #ifdef FEAT_MBYTE_IME
412 # ifdef DYNAMIC_IME
413 	"+multi_byte_ime/dyn",
414 # else
415 	"+multi_byte_ime",
416 # endif
417 #else
418 	"+multi_byte",
419 #endif
420 #ifdef FEAT_MULTI_LANG
421 	"+multi_lang",
422 #else
423 	"-multi_lang",
424 #endif
425 #ifdef FEAT_MZSCHEME
426 # ifdef DYNAMIC_MZSCHEME
427 	"+mzscheme/dyn",
428 # else
429 	"+mzscheme",
430 # endif
431 #else
432 	"-mzscheme",
433 #endif
434 #ifdef FEAT_NETBEANS_INTG
435 	"+netbeans_intg",
436 #else
437 	"-netbeans_intg",
438 #endif
439 	"+num64",
440 #ifdef FEAT_GUI_MSWIN
441 # ifdef FEAT_OLE
442 	"+ole",
443 # else
444 	"-ole",
445 # endif
446 #endif
447 #ifdef FEAT_EVAL
448 	"+packages",
449 #else
450 	"-packages",
451 #endif
452 #ifdef FEAT_PATH_EXTRA
453 	"+path_extra",
454 #else
455 	"-path_extra",
456 #endif
457 #ifdef FEAT_PERL
458 # ifdef DYNAMIC_PERL
459 	"+perl/dyn",
460 # else
461 	"+perl",
462 # endif
463 #else
464 	"-perl",
465 #endif
466 #ifdef FEAT_PERSISTENT_UNDO
467 	"+persistent_undo",
468 #else
469 	"-persistent_undo",
470 #endif
471 #ifdef FEAT_PROP_POPUP
472 	"+popupwin",
473 #else
474 	"-popupwin",
475 #endif
476 #ifdef FEAT_PRINTER
477 # ifdef FEAT_POSTSCRIPT
478 	"+postscript",
479 # else
480 	"-postscript",
481 # endif
482 	"+printer",
483 #else
484 	"-printer",
485 #endif
486 #ifdef FEAT_PROFILE
487 	"+profile",
488 #else
489 	"-profile",
490 #endif
491 #ifdef FEAT_PYTHON
492 # ifdef DYNAMIC_PYTHON
493 	"+python/dyn",
494 # else
495 	"+python",
496 # endif
497 #else
498 	"-python",
499 #endif
500 #ifdef FEAT_PYTHON3
501 # ifdef DYNAMIC_PYTHON3
502 	"+python3/dyn",
503 # else
504 	"+python3",
505 # endif
506 #else
507 	"-python3",
508 #endif
509 #ifdef FEAT_QUICKFIX
510 	"+quickfix",
511 #else
512 	"-quickfix",
513 #endif
514 #ifdef FEAT_RELTIME
515 	"+reltime",
516 #else
517 	"-reltime",
518 #endif
519 #ifdef FEAT_RIGHTLEFT
520 	"+rightleft",
521 #else
522 	"-rightleft",
523 #endif
524 #ifdef FEAT_RUBY
525 # ifdef DYNAMIC_RUBY
526 	"+ruby/dyn",
527 # else
528 	"+ruby",
529 # endif
530 #else
531 	"-ruby",
532 #endif
533 	"+scrollbind",
534 #ifdef FEAT_SIGNS
535 	"+signs",
536 #else
537 	"-signs",
538 #endif
539 #ifdef FEAT_SMARTINDENT
540 	"+smartindent",
541 #else
542 	"-smartindent",
543 #endif
544 #ifdef FEAT_SOUND
545 	"+sound",
546 #else
547 	"-sound",
548 #endif
549 #ifdef FEAT_SPELL
550 	"+spell",
551 #else
552 	"-spell",
553 #endif
554 #ifdef STARTUPTIME
555 	"+startuptime",
556 #else
557 	"-startuptime",
558 #endif
559 #ifdef FEAT_STL_OPT
560 	"+statusline",
561 #else
562 	"-statusline",
563 #endif
564 	"-sun_workshop",
565 #ifdef FEAT_SYN_HL
566 	"+syntax",
567 #else
568 	"-syntax",
569 #endif
570 	    // only interesting on Unix systems
571 #if defined(USE_SYSTEM) && defined(UNIX)
572 	"+system()",
573 #endif
574 #ifdef FEAT_TAG_BINS
575 	"+tag_binary",
576 #else
577 	"-tag_binary",
578 #endif
579 	"-tag_old_static",
580 	"-tag_any_white",
581 #ifdef FEAT_TCL
582 # ifdef DYNAMIC_TCL
583 	"+tcl/dyn",
584 # else
585 	"+tcl",
586 # endif
587 #else
588 	"-tcl",
589 #endif
590 #ifdef FEAT_TERMGUICOLORS
591 	"+termguicolors",
592 #else
593 	"-termguicolors",
594 #endif
595 #ifdef FEAT_TERMINAL
596 	"+terminal",
597 #else
598 	"-terminal",
599 #endif
600 #if defined(UNIX)
601 // only Unix can have terminfo instead of termcap
602 # ifdef TERMINFO
603 	"+terminfo",
604 # else
605 	"-terminfo",
606 # endif
607 #endif
608 #ifdef FEAT_TERMRESPONSE
609 	"+termresponse",
610 #else
611 	"-termresponse",
612 #endif
613 #ifdef FEAT_TEXTOBJ
614 	"+textobjects",
615 #else
616 	"-textobjects",
617 #endif
618 #ifdef FEAT_PROP_POPUP
619 	"+textprop",
620 #else
621 	"-textprop",
622 #endif
623 #if !defined(UNIX)
624 // unix always includes termcap support
625 # ifdef HAVE_TGETENT
626 	"+tgetent",
627 # else
628 	"-tgetent",
629 # endif
630 #endif
631 #ifdef FEAT_TIMERS
632 	"+timers",
633 #else
634 	"-timers",
635 #endif
636 #ifdef FEAT_TITLE
637 	"+title",
638 #else
639 	"-title",
640 #endif
641 #ifdef FEAT_TOOLBAR
642 	"+toolbar",
643 #else
644 	"-toolbar",
645 #endif
646 	"+user_commands",
647 #ifdef FEAT_VARTABS
648 	"+vartabs",
649 #else
650 	"-vartabs",
651 #endif
652 	"+vertsplit",
653 	"+virtualedit",
654 	"+visual",
655 	"+visualextra",
656 #ifdef FEAT_VIMINFO
657 	"+viminfo",
658 #else
659 	"-viminfo",
660 #endif
661 	"+vreplace",
662 #ifdef MSWIN
663 # ifdef FEAT_VTP
664 	"+vtp",
665 # else
666 	"-vtp",
667 # endif
668 #endif
669 #ifdef FEAT_WILDIGN
670 	"+wildignore",
671 #else
672 	"-wildignore",
673 #endif
674 #ifdef FEAT_WILDMENU
675 	"+wildmenu",
676 #else
677 	"-wildmenu",
678 #endif
679 	"+windows",
680 #ifdef FEAT_WRITEBACKUP
681 	"+writebackup",
682 #else
683 	"-writebackup",
684 #endif
685 #if defined(UNIX) || defined(VMS)
686 # ifdef FEAT_X11
687 	"+X11",
688 # else
689 	"-X11",
690 # endif
691 #endif
692 #ifdef FEAT_XFONTSET
693 	"+xfontset",
694 #else
695 	"-xfontset",
696 #endif
697 #ifdef FEAT_XIM
698 	"+xim",
699 #else
700 	"-xim",
701 #endif
702 #ifdef MSWIN
703 # ifdef FEAT_XPM_W32
704 	"+xpm_w32",
705 # else
706 	"-xpm_w32",
707 # endif
708 #else
709 # ifdef HAVE_XPM
710 	"+xpm",
711 # else
712 	"-xpm",
713 # endif
714 #endif
715 #if defined(UNIX) || defined(VMS)
716 # ifdef USE_XSMP_INTERACT
717 	"+xsmp_interact",
718 # else
719 #  ifdef USE_XSMP
720 	"+xsmp",
721 #  else
722 	"-xsmp",
723 #  endif
724 # endif
725 # ifdef FEAT_XCLIPBOARD
726 	"+xterm_clipboard",
727 # else
728 	"-xterm_clipboard",
729 # endif
730 #endif
731 #ifdef FEAT_XTERM_SAVE
732 	"+xterm_save",
733 #else
734 	"-xterm_save",
735 #endif
736 	NULL
737 };
738 
739 static int included_patches[] =
740 {   /* Add new patch number below this line */
741 /**/
742     541,
743 /**/
744     540,
745 /**/
746     539,
747 /**/
748     538,
749 /**/
750     537,
751 /**/
752     536,
753 /**/
754     535,
755 /**/
756     534,
757 /**/
758     533,
759 /**/
760     532,
761 /**/
762     531,
763 /**/
764     530,
765 /**/
766     529,
767 /**/
768     528,
769 /**/
770     527,
771 /**/
772     526,
773 /**/
774     525,
775 /**/
776     524,
777 /**/
778     523,
779 /**/
780     522,
781 /**/
782     521,
783 /**/
784     520,
785 /**/
786     519,
787 /**/
788     518,
789 /**/
790     517,
791 /**/
792     516,
793 /**/
794     515,
795 /**/
796     514,
797 /**/
798     513,
799 /**/
800     512,
801 /**/
802     511,
803 /**/
804     510,
805 /**/
806     509,
807 /**/
808     508,
809 /**/
810     507,
811 /**/
812     506,
813 /**/
814     505,
815 /**/
816     504,
817 /**/
818     503,
819 /**/
820     502,
821 /**/
822     501,
823 /**/
824     500,
825 /**/
826     499,
827 /**/
828     498,
829 /**/
830     497,
831 /**/
832     496,
833 /**/
834     495,
835 /**/
836     494,
837 /**/
838     493,
839 /**/
840     492,
841 /**/
842     491,
843 /**/
844     490,
845 /**/
846     489,
847 /**/
848     488,
849 /**/
850     487,
851 /**/
852     486,
853 /**/
854     485,
855 /**/
856     484,
857 /**/
858     483,
859 /**/
860     482,
861 /**/
862     481,
863 /**/
864     480,
865 /**/
866     479,
867 /**/
868     478,
869 /**/
870     477,
871 /**/
872     476,
873 /**/
874     475,
875 /**/
876     474,
877 /**/
878     473,
879 /**/
880     472,
881 /**/
882     471,
883 /**/
884     470,
885 /**/
886     469,
887 /**/
888     468,
889 /**/
890     467,
891 /**/
892     466,
893 /**/
894     465,
895 /**/
896     464,
897 /**/
898     463,
899 /**/
900     462,
901 /**/
902     461,
903 /**/
904     460,
905 /**/
906     459,
907 /**/
908     458,
909 /**/
910     457,
911 /**/
912     456,
913 /**/
914     455,
915 /**/
916     454,
917 /**/
918     453,
919 /**/
920     452,
921 /**/
922     451,
923 /**/
924     450,
925 /**/
926     449,
927 /**/
928     448,
929 /**/
930     447,
931 /**/
932     446,
933 /**/
934     445,
935 /**/
936     444,
937 /**/
938     443,
939 /**/
940     442,
941 /**/
942     441,
943 /**/
944     440,
945 /**/
946     439,
947 /**/
948     438,
949 /**/
950     437,
951 /**/
952     436,
953 /**/
954     435,
955 /**/
956     434,
957 /**/
958     433,
959 /**/
960     432,
961 /**/
962     431,
963 /**/
964     430,
965 /**/
966     429,
967 /**/
968     428,
969 /**/
970     427,
971 /**/
972     426,
973 /**/
974     425,
975 /**/
976     424,
977 /**/
978     423,
979 /**/
980     422,
981 /**/
982     421,
983 /**/
984     420,
985 /**/
986     419,
987 /**/
988     418,
989 /**/
990     417,
991 /**/
992     416,
993 /**/
994     415,
995 /**/
996     414,
997 /**/
998     413,
999 /**/
1000     412,
1001 /**/
1002     411,
1003 /**/
1004     410,
1005 /**/
1006     409,
1007 /**/
1008     408,
1009 /**/
1010     407,
1011 /**/
1012     406,
1013 /**/
1014     405,
1015 /**/
1016     404,
1017 /**/
1018     403,
1019 /**/
1020     402,
1021 /**/
1022     401,
1023 /**/
1024     400,
1025 /**/
1026     399,
1027 /**/
1028     398,
1029 /**/
1030     397,
1031 /**/
1032     396,
1033 /**/
1034     395,
1035 /**/
1036     394,
1037 /**/
1038     393,
1039 /**/
1040     392,
1041 /**/
1042     391,
1043 /**/
1044     390,
1045 /**/
1046     389,
1047 /**/
1048     388,
1049 /**/
1050     387,
1051 /**/
1052     386,
1053 /**/
1054     385,
1055 /**/
1056     384,
1057 /**/
1058     383,
1059 /**/
1060     382,
1061 /**/
1062     381,
1063 /**/
1064     380,
1065 /**/
1066     379,
1067 /**/
1068     378,
1069 /**/
1070     377,
1071 /**/
1072     376,
1073 /**/
1074     375,
1075 /**/
1076     374,
1077 /**/
1078     373,
1079 /**/
1080     372,
1081 /**/
1082     371,
1083 /**/
1084     370,
1085 /**/
1086     369,
1087 /**/
1088     368,
1089 /**/
1090     367,
1091 /**/
1092     366,
1093 /**/
1094     365,
1095 /**/
1096     364,
1097 /**/
1098     363,
1099 /**/
1100     362,
1101 /**/
1102     361,
1103 /**/
1104     360,
1105 /**/
1106     359,
1107 /**/
1108     358,
1109 /**/
1110     357,
1111 /**/
1112     356,
1113 /**/
1114     355,
1115 /**/
1116     354,
1117 /**/
1118     353,
1119 /**/
1120     352,
1121 /**/
1122     351,
1123 /**/
1124     350,
1125 /**/
1126     349,
1127 /**/
1128     348,
1129 /**/
1130     347,
1131 /**/
1132     346,
1133 /**/
1134     345,
1135 /**/
1136     344,
1137 /**/
1138     343,
1139 /**/
1140     342,
1141 /**/
1142     341,
1143 /**/
1144     340,
1145 /**/
1146     339,
1147 /**/
1148     338,
1149 /**/
1150     337,
1151 /**/
1152     336,
1153 /**/
1154     335,
1155 /**/
1156     334,
1157 /**/
1158     333,
1159 /**/
1160     332,
1161 /**/
1162     331,
1163 /**/
1164     330,
1165 /**/
1166     329,
1167 /**/
1168     328,
1169 /**/
1170     327,
1171 /**/
1172     326,
1173 /**/
1174     325,
1175 /**/
1176     324,
1177 /**/
1178     323,
1179 /**/
1180     322,
1181 /**/
1182     321,
1183 /**/
1184     320,
1185 /**/
1186     319,
1187 /**/
1188     318,
1189 /**/
1190     317,
1191 /**/
1192     316,
1193 /**/
1194     315,
1195 /**/
1196     314,
1197 /**/
1198     313,
1199 /**/
1200     312,
1201 /**/
1202     311,
1203 /**/
1204     310,
1205 /**/
1206     309,
1207 /**/
1208     308,
1209 /**/
1210     307,
1211 /**/
1212     306,
1213 /**/
1214     305,
1215 /**/
1216     304,
1217 /**/
1218     303,
1219 /**/
1220     302,
1221 /**/
1222     301,
1223 /**/
1224     300,
1225 /**/
1226     299,
1227 /**/
1228     298,
1229 /**/
1230     297,
1231 /**/
1232     296,
1233 /**/
1234     295,
1235 /**/
1236     294,
1237 /**/
1238     293,
1239 /**/
1240     292,
1241 /**/
1242     291,
1243 /**/
1244     290,
1245 /**/
1246     289,
1247 /**/
1248     288,
1249 /**/
1250     287,
1251 /**/
1252     286,
1253 /**/
1254     285,
1255 /**/
1256     284,
1257 /**/
1258     283,
1259 /**/
1260     282,
1261 /**/
1262     281,
1263 /**/
1264     280,
1265 /**/
1266     279,
1267 /**/
1268     278,
1269 /**/
1270     277,
1271 /**/
1272     276,
1273 /**/
1274     275,
1275 /**/
1276     274,
1277 /**/
1278     273,
1279 /**/
1280     272,
1281 /**/
1282     271,
1283 /**/
1284     270,
1285 /**/
1286     269,
1287 /**/
1288     268,
1289 /**/
1290     267,
1291 /**/
1292     266,
1293 /**/
1294     265,
1295 /**/
1296     264,
1297 /**/
1298     263,
1299 /**/
1300     262,
1301 /**/
1302     261,
1303 /**/
1304     260,
1305 /**/
1306     259,
1307 /**/
1308     258,
1309 /**/
1310     257,
1311 /**/
1312     256,
1313 /**/
1314     255,
1315 /**/
1316     254,
1317 /**/
1318     253,
1319 /**/
1320     252,
1321 /**/
1322     251,
1323 /**/
1324     250,
1325 /**/
1326     249,
1327 /**/
1328     248,
1329 /**/
1330     247,
1331 /**/
1332     246,
1333 /**/
1334     245,
1335 /**/
1336     244,
1337 /**/
1338     243,
1339 /**/
1340     242,
1341 /**/
1342     241,
1343 /**/
1344     240,
1345 /**/
1346     239,
1347 /**/
1348     238,
1349 /**/
1350     237,
1351 /**/
1352     236,
1353 /**/
1354     235,
1355 /**/
1356     234,
1357 /**/
1358     233,
1359 /**/
1360     232,
1361 /**/
1362     231,
1363 /**/
1364     230,
1365 /**/
1366     229,
1367 /**/
1368     228,
1369 /**/
1370     227,
1371 /**/
1372     226,
1373 /**/
1374     225,
1375 /**/
1376     224,
1377 /**/
1378     223,
1379 /**/
1380     222,
1381 /**/
1382     221,
1383 /**/
1384     220,
1385 /**/
1386     219,
1387 /**/
1388     218,
1389 /**/
1390     217,
1391 /**/
1392     216,
1393 /**/
1394     215,
1395 /**/
1396     214,
1397 /**/
1398     213,
1399 /**/
1400     212,
1401 /**/
1402     211,
1403 /**/
1404     210,
1405 /**/
1406     209,
1407 /**/
1408     208,
1409 /**/
1410     207,
1411 /**/
1412     206,
1413 /**/
1414     205,
1415 /**/
1416     204,
1417 /**/
1418     203,
1419 /**/
1420     202,
1421 /**/
1422     201,
1423 /**/
1424     200,
1425 /**/
1426     199,
1427 /**/
1428     198,
1429 /**/
1430     197,
1431 /**/
1432     196,
1433 /**/
1434     195,
1435 /**/
1436     194,
1437 /**/
1438     193,
1439 /**/
1440     192,
1441 /**/
1442     191,
1443 /**/
1444     190,
1445 /**/
1446     189,
1447 /**/
1448     188,
1449 /**/
1450     187,
1451 /**/
1452     186,
1453 /**/
1454     185,
1455 /**/
1456     184,
1457 /**/
1458     183,
1459 /**/
1460     182,
1461 /**/
1462     181,
1463 /**/
1464     180,
1465 /**/
1466     179,
1467 /**/
1468     178,
1469 /**/
1470     177,
1471 /**/
1472     176,
1473 /**/
1474     175,
1475 /**/
1476     174,
1477 /**/
1478     173,
1479 /**/
1480     172,
1481 /**/
1482     171,
1483 /**/
1484     170,
1485 /**/
1486     169,
1487 /**/
1488     168,
1489 /**/
1490     167,
1491 /**/
1492     166,
1493 /**/
1494     165,
1495 /**/
1496     164,
1497 /**/
1498     163,
1499 /**/
1500     162,
1501 /**/
1502     161,
1503 /**/
1504     160,
1505 /**/
1506     159,
1507 /**/
1508     158,
1509 /**/
1510     157,
1511 /**/
1512     156,
1513 /**/
1514     155,
1515 /**/
1516     154,
1517 /**/
1518     153,
1519 /**/
1520     152,
1521 /**/
1522     151,
1523 /**/
1524     150,
1525 /**/
1526     149,
1527 /**/
1528     148,
1529 /**/
1530     147,
1531 /**/
1532     146,
1533 /**/
1534     145,
1535 /**/
1536     144,
1537 /**/
1538     143,
1539 /**/
1540     142,
1541 /**/
1542     141,
1543 /**/
1544     140,
1545 /**/
1546     139,
1547 /**/
1548     138,
1549 /**/
1550     137,
1551 /**/
1552     136,
1553 /**/
1554     135,
1555 /**/
1556     134,
1557 /**/
1558     133,
1559 /**/
1560     132,
1561 /**/
1562     131,
1563 /**/
1564     130,
1565 /**/
1566     129,
1567 /**/
1568     128,
1569 /**/
1570     127,
1571 /**/
1572     126,
1573 /**/
1574     125,
1575 /**/
1576     124,
1577 /**/
1578     123,
1579 /**/
1580     122,
1581 /**/
1582     121,
1583 /**/
1584     120,
1585 /**/
1586     119,
1587 /**/
1588     118,
1589 /**/
1590     117,
1591 /**/
1592     116,
1593 /**/
1594     115,
1595 /**/
1596     114,
1597 /**/
1598     113,
1599 /**/
1600     112,
1601 /**/
1602     111,
1603 /**/
1604     110,
1605 /**/
1606     109,
1607 /**/
1608     108,
1609 /**/
1610     107,
1611 /**/
1612     106,
1613 /**/
1614     105,
1615 /**/
1616     104,
1617 /**/
1618     103,
1619 /**/
1620     102,
1621 /**/
1622     101,
1623 /**/
1624     100,
1625 /**/
1626     99,
1627 /**/
1628     98,
1629 /**/
1630     97,
1631 /**/
1632     96,
1633 /**/
1634     95,
1635 /**/
1636     94,
1637 /**/
1638     93,
1639 /**/
1640     92,
1641 /**/
1642     91,
1643 /**/
1644     90,
1645 /**/
1646     89,
1647 /**/
1648     88,
1649 /**/
1650     87,
1651 /**/
1652     86,
1653 /**/
1654     85,
1655 /**/
1656     84,
1657 /**/
1658     83,
1659 /**/
1660     82,
1661 /**/
1662     81,
1663 /**/
1664     80,
1665 /**/
1666     79,
1667 /**/
1668     78,
1669 /**/
1670     77,
1671 /**/
1672     76,
1673 /**/
1674     75,
1675 /**/
1676     74,
1677 /**/
1678     73,
1679 /**/
1680     72,
1681 /**/
1682     71,
1683 /**/
1684     70,
1685 /**/
1686     69,
1687 /**/
1688     68,
1689 /**/
1690     67,
1691 /**/
1692     66,
1693 /**/
1694     65,
1695 /**/
1696     64,
1697 /**/
1698     63,
1699 /**/
1700     62,
1701 /**/
1702     61,
1703 /**/
1704     60,
1705 /**/
1706     59,
1707 /**/
1708     58,
1709 /**/
1710     57,
1711 /**/
1712     56,
1713 /**/
1714     55,
1715 /**/
1716     54,
1717 /**/
1718     53,
1719 /**/
1720     52,
1721 /**/
1722     51,
1723 /**/
1724     50,
1725 /**/
1726     49,
1727 /**/
1728     48,
1729 /**/
1730     47,
1731 /**/
1732     46,
1733 /**/
1734     45,
1735 /**/
1736     44,
1737 /**/
1738     43,
1739 /**/
1740     42,
1741 /**/
1742     41,
1743 /**/
1744     40,
1745 /**/
1746     39,
1747 /**/
1748     38,
1749 /**/
1750     37,
1751 /**/
1752     36,
1753 /**/
1754     35,
1755 /**/
1756     34,
1757 /**/
1758     33,
1759 /**/
1760     32,
1761 /**/
1762     31,
1763 /**/
1764     30,
1765 /**/
1766     29,
1767 /**/
1768     28,
1769 /**/
1770     27,
1771 /**/
1772     26,
1773 /**/
1774     25,
1775 /**/
1776     24,
1777 /**/
1778     23,
1779 /**/
1780     22,
1781 /**/
1782     21,
1783 /**/
1784     20,
1785 /**/
1786     19,
1787 /**/
1788     18,
1789 /**/
1790     17,
1791 /**/
1792     16,
1793 /**/
1794     15,
1795 /**/
1796     14,
1797 /**/
1798     13,
1799 /**/
1800     12,
1801 /**/
1802     11,
1803 /**/
1804     10,
1805 /**/
1806     9,
1807 /**/
1808     8,
1809 /**/
1810     7,
1811 /**/
1812     6,
1813 /**/
1814     5,
1815 /**/
1816     4,
1817 /**/
1818     3,
1819 /**/
1820     2,
1821 /**/
1822     1,
1823 /**/
1824     0
1825 };
1826 
1827 /*
1828  * Place to put a short description when adding a feature with a patch.
1829  * Keep it short, e.g.,: "relative numbers", "persistent undo".
1830  * Also add a comment marker to separate the lines.
1831  * See the official Vim patches for the diff format: It must use a context of
1832  * one line only.  Create it by hand or use "diff -C2" and edit the patch.
1833  */
1834 static char *(extra_patches[]) =
1835 {   /* Add your patch description below this line */
1836 /**/
1837     NULL
1838 };
1839 
1840     int
1841 highest_patch(void)
1842 {
1843     // this relies on the highest patch number to be the first entry
1844     return included_patches[0];
1845 }
1846 
1847 #if defined(FEAT_EVAL) || defined(PROTO)
1848 /*
1849  * Return TRUE if patch "n" has been included.
1850  */
1851     int
1852 has_patch(int n)
1853 {
1854     int		i;
1855 
1856     for (i = 0; included_patches[i] != 0; ++i)
1857 	if (included_patches[i] == n)
1858 	    return TRUE;
1859     return FALSE;
1860 }
1861 #endif
1862 
1863     void
1864 ex_version(exarg_T *eap)
1865 {
1866     /*
1867      * Ignore a ":version 9.99" command.
1868      */
1869     if (*eap->arg == NUL)
1870     {
1871 	msg_putchar('\n');
1872 	list_version();
1873     }
1874 }
1875 
1876 /*
1877  * Output a string for the version message.  If it's going to wrap, output a
1878  * newline, unless the message is too long to fit on the screen anyway.
1879  * When "wrap" is TRUE wrap the string in [].
1880  */
1881     static void
1882 version_msg_wrap(char_u *s, int wrap)
1883 {
1884     int		len = (int)vim_strsize(s) + (wrap ? 2 : 0);
1885 
1886     if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1887 								&& *s != '\n')
1888 	msg_putchar('\n');
1889     if (!got_int)
1890     {
1891 	if (wrap)
1892 	    msg_puts("[");
1893 	msg_puts((char *)s);
1894 	if (wrap)
1895 	    msg_puts("]");
1896     }
1897 }
1898 
1899     static void
1900 version_msg(char *s)
1901 {
1902     version_msg_wrap((char_u *)s, FALSE);
1903 }
1904 
1905 /*
1906  * List all features aligned in columns, dictionary style.
1907  */
1908     static void
1909 list_features(void)
1910 {
1911     list_in_columns((char_u **)features, -1, -1);
1912 }
1913 
1914 /*
1915  * List string items nicely aligned in columns.
1916  * When "size" is < 0 then the last entry is marked with NULL.
1917  * The entry with index "current" is inclosed in [].
1918  */
1919     void
1920 list_in_columns(char_u **items, int size, int current)
1921 {
1922     int		i;
1923     int		ncol;
1924     int		nrow;
1925     int		cur_row = 1;
1926     int		item_count = 0;
1927     int		width = 0;
1928 #ifdef FEAT_SYN_HL
1929     int		use_highlight = (items == (char_u **)features);
1930 #endif
1931 
1932     // Find the length of the longest item, use that + 1 as the column
1933     // width.
1934     for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
1935     {
1936 	int l = (int)vim_strsize(items[i]) + (i == current ? 2 : 0);
1937 
1938 	if (l > width)
1939 	    width = l;
1940 	++item_count;
1941     }
1942     width += 1;
1943 
1944     if (Columns < width)
1945     {
1946 	// Not enough screen columns - show one per line
1947 	for (i = 0; i < item_count; ++i)
1948 	{
1949 	    version_msg_wrap(items[i], i == current);
1950 	    if (msg_col > 0 && i < item_count - 1)
1951 		msg_putchar('\n');
1952 	}
1953 	return;
1954     }
1955 
1956     // The rightmost column doesn't need a separator.
1957     // Sacrifice it to fit in one more column if possible.
1958     ncol = (int) (Columns + 1) / width;
1959     nrow = item_count / ncol + (item_count % ncol ? 1 : 0);
1960 
1961     // "i" counts columns then rows.  "idx" counts rows then columns.
1962     for (i = 0; !got_int && i < nrow * ncol; ++i)
1963     {
1964 	int idx = (i / ncol) + (i % ncol) * nrow;
1965 
1966 	if (idx < item_count)
1967 	{
1968 	    int last_col = (i + 1) % ncol == 0;
1969 
1970 	    if (idx == current)
1971 		msg_putchar('[');
1972 #ifdef FEAT_SYN_HL
1973 	    if (use_highlight && items[idx][0] == '-')
1974 		msg_puts_attr((char *)items[idx], HL_ATTR(HLF_W));
1975 	    else
1976 #endif
1977 		msg_puts((char *)items[idx]);
1978 	    if (idx == current)
1979 		msg_putchar(']');
1980 	    if (last_col)
1981 	    {
1982 		if (msg_col > 0 && cur_row < nrow)
1983 		    msg_putchar('\n');
1984 		++cur_row;
1985 	    }
1986 	    else
1987 	    {
1988 		while (msg_col % width)
1989 		    msg_putchar(' ');
1990 	    }
1991 	}
1992 	else
1993 	{
1994 	    // this row is out of items, thus at the end of the row
1995 	    if (msg_col > 0)
1996 	    {
1997 		if (cur_row < nrow)
1998 		    msg_putchar('\n');
1999 		++cur_row;
2000 	    }
2001 	}
2002     }
2003 }
2004 
2005     void
2006 list_version(void)
2007 {
2008     int		i;
2009     int		first;
2010     char	*s = "";
2011 
2012     /*
2013      * When adding features here, don't forget to update the list of
2014      * internal variables in eval.c!
2015      */
2016     init_longVersion();
2017     msg(longVersion);
2018 #ifdef MSWIN
2019 # ifdef FEAT_GUI_MSWIN
2020 #  ifdef VIMDLL
2021 #   ifdef _WIN64
2022     msg_puts(_("\nMS-Windows 64-bit GUI/console version"));
2023 #   else
2024     msg_puts(_("\nMS-Windows 32-bit GUI/console version"));
2025 #   endif
2026 #  else
2027 #   ifdef _WIN64
2028     msg_puts(_("\nMS-Windows 64-bit GUI version"));
2029 #   else
2030     msg_puts(_("\nMS-Windows 32-bit GUI version"));
2031 #   endif
2032 #  endif
2033 #  ifdef FEAT_OLE
2034     msg_puts(_(" with OLE support"));
2035 #  endif
2036 # else
2037 #  ifdef _WIN64
2038     msg_puts(_("\nMS-Windows 64-bit console version"));
2039 #  else
2040     msg_puts(_("\nMS-Windows 32-bit console version"));
2041 #  endif
2042 # endif
2043 #endif
2044 #if defined(MACOS_X)
2045 # if defined(MACOS_X_DARWIN)
2046     msg_puts(_("\nmacOS version"));
2047 # else
2048     msg_puts(_("\nmacOS version w/o darwin feat."));
2049 # endif
2050 #endif
2051 
2052 #ifdef VMS
2053     msg_puts(_("\nOpenVMS version"));
2054 # ifdef HAVE_PATHDEF
2055     if (*compiled_arch != NUL)
2056     {
2057 	msg_puts(" - ");
2058 	msg_puts((char *)compiled_arch);
2059     }
2060 # endif
2061 
2062 #endif
2063 
2064     // Print the list of patch numbers if there is at least one.
2065     // Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45"
2066     if (included_patches[0] != 0)
2067     {
2068 	msg_puts(_("\nIncluded patches: "));
2069 	first = -1;
2070 	// find last one
2071 	for (i = 0; included_patches[i] != 0; ++i)
2072 	    ;
2073 	while (--i >= 0)
2074 	{
2075 	    if (first < 0)
2076 		first = included_patches[i];
2077 	    if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
2078 	    {
2079 		msg_puts(s);
2080 		s = ", ";
2081 		msg_outnum((long)first);
2082 		if (first != included_patches[i])
2083 		{
2084 		    msg_puts("-");
2085 		    msg_outnum((long)included_patches[i]);
2086 		}
2087 		first = -1;
2088 	    }
2089 	}
2090     }
2091 
2092     // Print the list of extra patch descriptions if there is at least one.
2093     if (extra_patches[0] != NULL)
2094     {
2095 	msg_puts(_("\nExtra patches: "));
2096 	s = "";
2097 	for (i = 0; extra_patches[i] != NULL; ++i)
2098 	{
2099 	    msg_puts(s);
2100 	    s = ", ";
2101 	    msg_puts(extra_patches[i]);
2102 	}
2103     }
2104 
2105 #ifdef MODIFIED_BY
2106     msg_puts("\n");
2107     msg_puts(_("Modified by "));
2108     msg_puts(MODIFIED_BY);
2109 #endif
2110 
2111 #ifdef HAVE_PATHDEF
2112     if (*compiled_user != NUL || *compiled_sys != NUL)
2113     {
2114 	msg_puts(_("\nCompiled "));
2115 	if (*compiled_user != NUL)
2116 	{
2117 	    msg_puts(_("by "));
2118 	    msg_puts((char *)compiled_user);
2119 	}
2120 	if (*compiled_sys != NUL)
2121 	{
2122 	    msg_puts("@");
2123 	    msg_puts((char *)compiled_sys);
2124 	}
2125     }
2126 #endif
2127 
2128 #ifdef FEAT_HUGE
2129     msg_puts(_("\nHuge version "));
2130 #else
2131 # ifdef FEAT_BIG
2132     msg_puts(_("\nBig version "));
2133 # else
2134 #  ifdef FEAT_NORMAL
2135     msg_puts(_("\nNormal version "));
2136 #  else
2137 #   ifdef FEAT_SMALL
2138     msg_puts(_("\nSmall version "));
2139 #   else
2140     msg_puts(_("\nTiny version "));
2141 #   endif
2142 #  endif
2143 # endif
2144 #endif
2145 #ifndef FEAT_GUI
2146     msg_puts(_("without GUI."));
2147 #else
2148 # ifdef FEAT_GUI_GTK
2149 #  ifdef USE_GTK3
2150     msg_puts(_("with GTK3 GUI."));
2151 #  else
2152 #   ifdef FEAT_GUI_GNOME
2153      msg_puts(_("with GTK2-GNOME GUI."));
2154 #   else
2155      msg_puts(_("with GTK2 GUI."));
2156 #   endif
2157 # endif
2158 # else
2159 #  ifdef FEAT_GUI_MOTIF
2160     msg_puts(_("with X11-Motif GUI."));
2161 #  else
2162 #   ifdef FEAT_GUI_ATHENA
2163 #    ifdef FEAT_GUI_NEXTAW
2164     msg_puts(_("with X11-neXtaw GUI."));
2165 #    else
2166     msg_puts(_("with X11-Athena GUI."));
2167 #    endif
2168 #   else
2169 #    ifdef FEAT_GUI_HAIKU
2170     msg_puts(_("with Haiku GUI."));
2171 #    else
2172 #     ifdef FEAT_GUI_PHOTON
2173     msg_puts(_("with Photon GUI."));
2174 #     else
2175 #      if defined(MSWIN)
2176     msg_puts(_("with GUI."));
2177 #      else
2178 #	if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
2179     msg_puts(_("with Carbon GUI."));
2180 #	else
2181 #	 if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
2182     msg_puts(_("with Cocoa GUI."));
2183 #	 else
2184 #	 endif
2185 #	endif
2186 #	 endif
2187 #      endif
2188 #    endif
2189 #   endif
2190 #  endif
2191 # endif
2192 #endif
2193     version_msg(_("  Features included (+) or not (-):\n"));
2194 
2195     list_features();
2196     if (msg_col > 0)
2197 	msg_putchar('\n');
2198 
2199 #ifdef SYS_VIMRC_FILE
2200     version_msg(_("   system vimrc file: \""));
2201     version_msg(SYS_VIMRC_FILE);
2202     version_msg("\"\n");
2203 #endif
2204 #ifdef USR_VIMRC_FILE
2205     version_msg(_("     user vimrc file: \""));
2206     version_msg(USR_VIMRC_FILE);
2207     version_msg("\"\n");
2208 #endif
2209 #ifdef USR_VIMRC_FILE2
2210     version_msg(_(" 2nd user vimrc file: \""));
2211     version_msg(USR_VIMRC_FILE2);
2212     version_msg("\"\n");
2213 #endif
2214 #ifdef USR_VIMRC_FILE3
2215     version_msg(_(" 3rd user vimrc file: \""));
2216     version_msg(USR_VIMRC_FILE3);
2217     version_msg("\"\n");
2218 #endif
2219 #ifdef USR_EXRC_FILE
2220     version_msg(_("      user exrc file: \""));
2221     version_msg(USR_EXRC_FILE);
2222     version_msg("\"\n");
2223 #endif
2224 #ifdef USR_EXRC_FILE2
2225     version_msg(_("  2nd user exrc file: \""));
2226     version_msg(USR_EXRC_FILE2);
2227     version_msg("\"\n");
2228 #endif
2229 #ifdef FEAT_GUI
2230 # ifdef SYS_GVIMRC_FILE
2231     version_msg(_("  system gvimrc file: \""));
2232     version_msg(SYS_GVIMRC_FILE);
2233     version_msg("\"\n");
2234 # endif
2235     version_msg(_("    user gvimrc file: \""));
2236     version_msg(USR_GVIMRC_FILE);
2237     version_msg("\"\n");
2238 # ifdef USR_GVIMRC_FILE2
2239     version_msg(_("2nd user gvimrc file: \""));
2240     version_msg(USR_GVIMRC_FILE2);
2241     version_msg("\"\n");
2242 # endif
2243 # ifdef USR_GVIMRC_FILE3
2244     version_msg(_("3rd user gvimrc file: \""));
2245     version_msg(USR_GVIMRC_FILE3);
2246     version_msg("\"\n");
2247 # endif
2248 #endif
2249     version_msg(_("       defaults file: \""));
2250     version_msg(VIM_DEFAULTS_FILE);
2251     version_msg("\"\n");
2252 #ifdef FEAT_GUI
2253 # ifdef SYS_MENU_FILE
2254     version_msg(_("    system menu file: \""));
2255     version_msg(SYS_MENU_FILE);
2256     version_msg("\"\n");
2257 # endif
2258 #endif
2259 #ifdef HAVE_PATHDEF
2260     if (*default_vim_dir != NUL)
2261     {
2262 	version_msg(_("  fall-back for $VIM: \""));
2263 	version_msg((char *)default_vim_dir);
2264 	version_msg("\"\n");
2265     }
2266     if (*default_vimruntime_dir != NUL)
2267     {
2268 	version_msg(_(" f-b for $VIMRUNTIME: \""));
2269 	version_msg((char *)default_vimruntime_dir);
2270 	version_msg("\"\n");
2271     }
2272     version_msg(_("Compilation: "));
2273     version_msg((char *)all_cflags);
2274     version_msg("\n");
2275 #ifdef VMS
2276     if (*compiler_version != NUL)
2277     {
2278 	version_msg(_("Compiler: "));
2279 	version_msg((char *)compiler_version);
2280 	version_msg("\n");
2281     }
2282 #endif
2283     version_msg(_("Linking: "));
2284     version_msg((char *)all_lflags);
2285 #endif
2286 #ifdef DEBUG
2287     version_msg("\n");
2288     version_msg(_("  DEBUG BUILD"));
2289 #endif
2290 }
2291 
2292 static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
2293 static void intro_message(int colon);
2294 
2295 /*
2296  * Show the intro message when not editing a file.
2297  */
2298     void
2299 maybe_intro_message(void)
2300 {
2301     if (BUFEMPTY()
2302 	    && curbuf->b_fname == NULL
2303 	    && firstwin->w_next == NULL
2304 	    && vim_strchr(p_shm, SHM_INTRO) == NULL)
2305 	intro_message(FALSE);
2306 }
2307 
2308 /*
2309  * Give an introductory message about Vim.
2310  * Only used when starting Vim on an empty file, without a file name.
2311  * Or with the ":intro" command (for Sven :-).
2312  */
2313     static void
2314 intro_message(
2315     int		colon)		// TRUE for ":intro"
2316 {
2317     int		i;
2318     int		row;
2319     int		blanklines;
2320     int		sponsor;
2321     char	*p;
2322     static char	*(lines[]) =
2323     {
2324 	N_("VIM - Vi IMproved"),
2325 	"",
2326 	N_("version "),
2327 	N_("by Bram Moolenaar et al."),
2328 #ifdef MODIFIED_BY
2329 	" ",
2330 #endif
2331 	N_("Vim is open source and freely distributable"),
2332 	"",
2333 	N_("Help poor children in Uganda!"),
2334 	N_("type  :help iccf<Enter>       for information "),
2335 	"",
2336 	N_("type  :q<Enter>               to exit         "),
2337 	N_("type  :help<Enter>  or  <F1>  for on-line help"),
2338 	N_("type  :help version8<Enter>   for version info"),
2339 	NULL,
2340 	"",
2341 	N_("Running in Vi compatible mode"),
2342 	N_("type  :set nocp<Enter>        for Vim defaults"),
2343 	N_("type  :help cp-default<Enter> for info on this"),
2344     };
2345 #ifdef FEAT_GUI
2346     static char	*(gui_lines[]) =
2347     {
2348 	NULL,
2349 	NULL,
2350 	NULL,
2351 	NULL,
2352 #ifdef MODIFIED_BY
2353 	NULL,
2354 #endif
2355 	NULL,
2356 	NULL,
2357 	NULL,
2358 	N_("menu  Help->Orphans           for information    "),
2359 	NULL,
2360 	N_("Running modeless, typed text is inserted"),
2361 	N_("menu  Edit->Global Settings->Toggle Insert Mode  "),
2362 	N_("                              for two modes      "),
2363 	NULL,
2364 	NULL,
2365 	NULL,
2366 	N_("menu  Edit->Global Settings->Toggle Vi Compatible"),
2367 	N_("                              for Vim defaults   "),
2368     };
2369 #endif
2370 
2371     // blanklines = screen height - # message lines
2372     blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
2373     if (!p_cp)
2374 	blanklines += 4;  // add 4 for not showing "Vi compatible" message
2375 
2376     // Don't overwrite a statusline.  Depends on 'cmdheight'.
2377     if (p_ls > 1)
2378 	blanklines -= Rows - topframe->fr_height;
2379     if (blanklines < 0)
2380 	blanklines = 0;
2381 
2382     // Show the sponsor and register message one out of four times, the Uganda
2383     // message two out of four times.
2384     sponsor = (int)time(NULL);
2385     sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
2386 
2387     // start displaying the message lines after half of the blank lines
2388     row = blanklines / 2;
2389     if ((row >= 2 && Columns >= 50) || colon)
2390     {
2391 	for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
2392 	{
2393 	    p = lines[i];
2394 #ifdef FEAT_GUI
2395 	    if (p_im && gui.in_use && gui_lines[i] != NULL)
2396 		p = gui_lines[i];
2397 #endif
2398 	    if (p == NULL)
2399 	    {
2400 		if (!p_cp)
2401 		    break;
2402 		continue;
2403 	    }
2404 	    if (sponsor != 0)
2405 	    {
2406 		if (strstr(p, "children") != NULL)
2407 		    p = sponsor < 0
2408 			? N_("Sponsor Vim development!")
2409 			: N_("Become a registered Vim user!");
2410 		else if (strstr(p, "iccf") != NULL)
2411 		    p = sponsor < 0
2412 			? N_("type  :help sponsor<Enter>    for information ")
2413 			: N_("type  :help register<Enter>   for information ");
2414 		else if (strstr(p, "Orphans") != NULL)
2415 		    p = N_("menu  Help->Sponsor/Register  for information    ");
2416 	    }
2417 	    if (*p != NUL)
2418 		do_intro_line(row, (char_u *)_(p), i == 2, 0);
2419 	    ++row;
2420 	}
2421     }
2422 
2423     // Make the wait-return message appear just below the text.
2424     if (colon)
2425 	msg_row = row;
2426 }
2427 
2428     static void
2429 do_intro_line(
2430     int		row,
2431     char_u	*mesg,
2432     int		add_version,
2433     int		attr)
2434 {
2435     char_u	vers[20];
2436     int		col;
2437     char_u	*p;
2438     int		l;
2439     int		clen;
2440 #ifdef MODIFIED_BY
2441 # define MODBY_LEN 150
2442     char_u	modby[MODBY_LEN];
2443 
2444     if (*mesg == ' ')
2445     {
2446 	vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
2447 	l = (int)STRLEN(modby);
2448 	vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
2449 	mesg = modby;
2450     }
2451 #endif
2452 
2453     // Center the message horizontally.
2454     col = vim_strsize(mesg);
2455     if (add_version)
2456     {
2457 	STRCPY(vers, mediumVersion);
2458 	if (highest_patch())
2459 	{
2460 	    // Check for 9.9x or 9.9xx, alpha/beta version
2461 	    if (isalpha((int)vers[3]))
2462 	    {
2463 		int len = (isalpha((int)vers[4])) ? 5 : 4;
2464 		sprintf((char *)vers + len, ".%d%s", highest_patch(),
2465 							 mediumVersion + len);
2466 	    }
2467 	    else
2468 		sprintf((char *)vers + 3, ".%d", highest_patch());
2469 	}
2470 	col += (int)STRLEN(vers);
2471     }
2472     col = (Columns - col) / 2;
2473     if (col < 0)
2474 	col = 0;
2475 
2476     // Split up in parts to highlight <> items differently.
2477     for (p = mesg; *p != NUL; p += l)
2478     {
2479 	clen = 0;
2480 	for (l = 0; p[l] != NUL
2481 			 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
2482 	{
2483 	    if (has_mbyte)
2484 	    {
2485 		clen += ptr2cells(p + l);
2486 		l += (*mb_ptr2len)(p + l) - 1;
2487 	    }
2488 	    else
2489 		clen += byte2cells(p[l]);
2490 	}
2491 	screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
2492 	col += clen;
2493     }
2494 
2495     // Add the version number to the version line.
2496     if (add_version)
2497 	screen_puts(vers, row, col, 0);
2498 }
2499 
2500 /*
2501  * ":intro": clear screen, display intro screen and wait for return.
2502  */
2503     void
2504 ex_intro(exarg_T *eap UNUSED)
2505 {
2506     screenclear();
2507     intro_message(TRUE);
2508     wait_return(TRUE);
2509 }
2510