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