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