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