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