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