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