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