blob: c5b76797460f0f9f4ca05bea431792c2e8e87d9c [file] [log] [blame]
Bram Moolenaaredf3f972016-08-29 22:49:24 +02001/* vi:set ts=8 sts=4 sw=4 noet:
Bram Moolenaar071d4272004-06-13 20:20:40 +00002 *
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
Bram Moolenaar071d4272004-06-13 20:20:40 +000012/*
13 * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
14 * It has been changed beyond recognition since then.
15 *
Bram Moolenaarabd56da2022-06-23 20:46:27 +010016 * Differences between version 8.2 and 9.0 can be found with ":help version9".
Bram Moolenaar640102482016-09-12 16:23:34 +020017 * Differences between version 7.4 and 8.x can be found with ":help version8".
18 * Differences between version 6.4 and 7.x can be found with ":help version7".
19 * Differences between version 5.8 and 6.x can be found with ":help version6".
Bram Moolenaar071d4272004-06-13 20:20:40 +000020 * Differences between version 4.x and 5.x can be found with ":help version5".
21 * Differences between version 3.0 and 4.x can be found with ":help version4".
22 * All the remarks about older versions have been removed, they are not very
23 * interesting.
24 */
25
26#include "version.h"
27
Bram Moolenaard042c562005-06-30 22:04:15 +000028char *Version = VIM_VERSION_SHORT;
29static char *mediumVersion = VIM_VERSION_MEDIUM;
Bram Moolenaar071d4272004-06-13 20:20:40 +000030
31#if defined(HAVE_DATE_TIME) || defined(PROTO)
32# if (defined(VMS) && defined(VAXC)) || defined(PROTO)
33char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
34 + sizeof(__TIME__) + 3];
Bram Moolenaar445f3032013-02-20 16:47:36 +010035
Bram Moolenaar071d4272004-06-13 20:20:40 +000036 void
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +020037init_longVersion(void)
Bram Moolenaar071d4272004-06-13 20:20:40 +000038{
39 /*
40 * Construct the long version string. Necessary because
Bram Moolenaarbdace832019-03-02 10:13:42 +010041 * VAX C can't concatenate strings in the preprocessor.
Bram Moolenaar071d4272004-06-13 20:20:40 +000042 */
43 strcpy(longVersion, VIM_VERSION_LONG_DATE);
Bram Moolenaar8f1dde52020-06-05 23:16:29 +020044#ifdef BUILD_DATE
45 strcat(longVersion, BUILD_DATE);
46#else
Bram Moolenaar071d4272004-06-13 20:20:40 +000047 strcat(longVersion, __DATE__);
48 strcat(longVersion, " ");
49 strcat(longVersion, __TIME__);
Bram Moolenaar8f1dde52020-06-05 23:16:29 +020050#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000051 strcat(longVersion, ")");
52}
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +020053
Bram Moolenaar071d4272004-06-13 20:20:40 +000054# else
Bram Moolenaar542ffe12021-09-17 20:45:30 +020055char *longVersion = NULL;
56
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +020057 void
58init_longVersion(void)
59{
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +020060 if (longVersion == NULL)
Bram Moolenaar278e8382020-04-13 18:25:33 +020061 {
Bram Moolenaar8f1dde52020-06-05 23:16:29 +020062#ifdef BUILD_DATE
63 char *date_time = BUILD_DATE;
64#else
Bram Moolenaar278e8382020-04-13 18:25:33 +020065 char *date_time = __DATE__ " " __TIME__;
Bram Moolenaar8f1dde52020-06-05 23:16:29 +020066#endif
Bram Moolenaar278e8382020-04-13 18:25:33 +020067 char *msg = _("%s (%s, compiled %s)");
68 size_t len = strlen(msg)
69 + strlen(VIM_VERSION_LONG_ONLY)
70 + strlen(VIM_VERSION_DATE_ONLY)
71 + strlen(date_time);
72
73 longVersion = alloc(len);
74 if (longVersion == NULL)
75 longVersion = VIM_VERSION_LONG;
76 else
77 vim_snprintf(longVersion, len, msg,
Bram Moolenaar542ffe12021-09-17 20:45:30 +020078 VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
Bram Moolenaar278e8382020-04-13 18:25:33 +020079 }
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +020080}
Bram Moolenaar071d4272004-06-13 20:20:40 +000081# endif
82#else
83char *longVersion = VIM_VERSION_LONG;
Bram Moolenaareee3e942018-06-24 14:44:46 +020084
85 void
86init_longVersion(void)
87{
88 // nothing to do
89}
Bram Moolenaar071d4272004-06-13 20:20:40 +000090#endif
91
Bram Moolenaar071d4272004-06-13 20:20:40 +000092static char *(features[]) =
93{
Bram Moolenaarb5ef5e12013-08-30 16:35:44 +020094#ifdef HAVE_ACL
95 "+acl",
96#else
97 "-acl",
98#endif
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +010099#ifdef AMIGA // only for Amiga systems
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100# ifdef FEAT_ARP
101 "+ARP",
102# else
103 "-ARP",
104# endif
105#endif
106#ifdef FEAT_ARABIC
107 "+arabic",
108#else
109 "-arabic",
110#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000111 "+autocmd",
Bram Moolenaar83ec2a72018-07-27 22:08:59 +0200112#ifdef FEAT_AUTOCHDIR
113 "+autochdir",
114#else
115 "-autochdir",
116#endif
Bram Moolenaare42a6d22017-11-12 19:21:51 +0100117#ifdef FEAT_AUTOSERVERNAME
118 "+autoservername",
119#else
120 "-autoservername",
121#endif
Bram Moolenaarc3719bd2017-11-18 22:13:31 +0100122#ifdef FEAT_BEVAL_GUI
Bram Moolenaar071d4272004-06-13 20:20:40 +0000123 "+balloon_eval",
124#else
125 "-balloon_eval",
126#endif
Bram Moolenaarc3719bd2017-11-18 22:13:31 +0100127#ifdef FEAT_BEVAL_TERM
Bram Moolenaar51b0f372017-11-18 18:52:04 +0100128 "+balloon_eval_term",
129#else
130 "-balloon_eval_term",
131#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000132#ifdef FEAT_BROWSE
133 "+browse",
134#else
135 "-browse",
136#endif
137#ifdef NO_BUILTIN_TCAPS
138 "-builtin_terms",
139#endif
140#ifdef SOME_BUILTIN_TCAPS
141 "+builtin_terms",
142#endif
143#ifdef ALL_BUILTIN_TCAPS
144 "++builtin_terms",
145#endif
146#ifdef FEAT_BYTEOFF
147 "+byte_offset",
148#else
149 "-byte_offset",
150#endif
Bram Moolenaar509ce2a2016-03-11 22:52:15 +0100151#ifdef FEAT_JOB_CHANNEL
Bram Moolenaar5aec4812016-01-25 20:15:45 +0100152 "+channel",
153#else
154 "-channel",
155#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000156 "+cindent",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000157#ifdef FEAT_CLIENTSERVER
158 "+clientserver",
159#else
160 "-clientserver",
161#endif
162#ifdef FEAT_CLIPBOARD
163 "+clipboard",
164#else
165 "-clipboard",
166#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000167 "+cmdline_compl",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000168 "+cmdline_hist",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000169#ifdef FEAT_CMDL_INFO
170 "+cmdline_info",
171#else
172 "-cmdline_info",
173#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000174 "+comments",
Bram Moolenaar860cae12010-06-05 23:22:07 +0200175#ifdef FEAT_CONCEAL
176 "+conceal",
177#else
178 "-conceal",
179#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000180#ifdef FEAT_CRYPT
181 "+cryptv",
182#else
183 "-cryptv",
184#endif
185#ifdef FEAT_CSCOPE
186 "+cscope",
187#else
188 "-cscope",
189#endif
Bram Moolenaar860cae12010-06-05 23:22:07 +0200190 "+cursorbind",
Bram Moolenaar17c7c012006-01-26 22:25:15 +0000191#ifdef CURSOR_SHAPE
192 "+cursorshape",
193#else
194 "-cursorshape",
195#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000196#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
197 "+dialog_con_gui",
198#else
199# if defined(FEAT_CON_DIALOG)
200 "+dialog_con",
201# else
202# if defined(FEAT_GUI_DIALOG)
203 "+dialog_gui",
204# else
205 "-dialog",
206# endif
207# endif
208#endif
209#ifdef FEAT_DIFF
210 "+diff",
211#else
212 "-diff",
213#endif
214#ifdef FEAT_DIGRAPHS
215 "+digraphs",
216#else
217 "-digraphs",
218#endif
Bram Moolenaar4f974752019-02-17 17:44:42 +0100219#ifdef FEAT_GUI_MSWIN
Bram Moolenaarb5a7a8b2014-08-06 14:52:30 +0200220# ifdef FEAT_DIRECTX
221 "+directx",
222# else
223 "-directx",
224# endif
225#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000226#ifdef FEAT_DND
227 "+dnd",
228#else
229 "-dnd",
230#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231 "-ebcdic",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000232#ifdef FEAT_EMACS_TAGS
233 "+emacs_tags",
234#else
235 "-emacs_tags",
236#endif
237#ifdef FEAT_EVAL
238 "+eval",
239#else
240 "-eval",
241#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000242 "+ex_extra",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000243#ifdef FEAT_SEARCH_EXTRA
244 "+extra_search",
245#else
246 "-extra_search",
247#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000248 "-farsi",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000249#ifdef FEAT_SEARCHPATH
250 "+file_in_path",
251#else
252 "-file_in_path",
253#endif
254#ifdef FEAT_FIND_ID
255 "+find_in_path",
256#else
257 "-find_in_path",
258#endif
Bram Moolenaar446cb832008-06-24 21:56:24 +0000259#ifdef FEAT_FLOAT
260 "+float",
261#else
262 "-float",
263#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000264#ifdef FEAT_FOLDING
265 "+folding",
266#else
267 "-folding",
268#endif
269#ifdef FEAT_FOOTER
270 "+footer",
271#else
272 "-footer",
273#endif
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +0100274 // only interesting on Unix systems
Bram Moolenaar071d4272004-06-13 20:20:40 +0000275#if !defined(USE_SYSTEM) && defined(UNIX)
276 "+fork()",
277#endif
278#ifdef FEAT_GETTEXT
279# ifdef DYNAMIC_GETTEXT
280 "+gettext/dyn",
281# else
282 "+gettext",
283# endif
284#else
285 "-gettext",
286#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000287 "-hangul_input",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000288#if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
289# ifdef DYNAMIC_ICONV
290 "+iconv/dyn",
291# else
292 "+iconv",
293# endif
294#else
295 "-iconv",
296#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000297 "+insert_expand",
Bram Moolenaar352f5542020-04-13 19:04:21 +0200298#ifdef FEAT_IPV6
299 "+ipv6",
300#else
301 "-ipv6",
302#endif
Bram Moolenaar509ce2a2016-03-11 22:52:15 +0100303#ifdef FEAT_JOB_CHANNEL
Bram Moolenaar835dc632016-02-07 14:27:38 +0100304 "+job",
305#else
306 "-job",
307#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000308 "+jumplist",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000309#ifdef FEAT_KEYMAP
310 "+keymap",
311#else
312 "-keymap",
313#endif
Bram Moolenaar9532fe72016-07-29 22:50:35 +0200314#ifdef FEAT_EVAL
315 "+lambda",
316#else
317 "-lambda",
318#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000319#ifdef FEAT_LANGMAP
320 "+langmap",
321#else
322 "-langmap",
323#endif
324#ifdef FEAT_LIBCALL
325 "+libcall",
326#else
327 "-libcall",
328#endif
329#ifdef FEAT_LINEBREAK
330 "+linebreak",
331#else
332 "-linebreak",
333#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334 "+lispindent",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000335 "+listcmds",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000336 "+localmap",
Bram Moolenaar0ba04292010-07-14 23:23:17 +0200337#ifdef FEAT_LUA
338# ifdef DYNAMIC_LUA
339 "+lua/dyn",
340# else
341 "+lua",
342# endif
343#else
344 "-lua",
345#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000346#ifdef FEAT_MENU
347 "+menu",
348#else
349 "-menu",
350#endif
351#ifdef FEAT_SESSION
352 "+mksession",
353#else
354 "-mksession",
355#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000356 "+modify_fname",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000357 "+mouse",
Bram Moolenaara1cb1d12019-10-17 23:00:07 +0200358#ifdef FEAT_MOUSESHAPE
Bram Moolenaar071d4272004-06-13 20:20:40 +0000359 "+mouseshape",
Bram Moolenaara1cb1d12019-10-17 23:00:07 +0200360#else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000361 "-mouseshape",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000362#endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200363
Bram Moolenaar071d4272004-06-13 20:20:40 +0000364#if defined(UNIX) || defined(VMS)
365# ifdef FEAT_MOUSE_DEC
366 "+mouse_dec",
367# else
368 "-mouse_dec",
369# endif
370# ifdef FEAT_MOUSE_GPM
Bram Moolenaar33fc4a62022-02-23 18:07:38 +0000371# ifdef DYNAMIC_GPM
372 "+mouse_gpm/dyn",
373# else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000374 "+mouse_gpm",
Bram Moolenaar33fc4a62022-02-23 18:07:38 +0000375# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000376# else
377 "-mouse_gpm",
378# endif
379# ifdef FEAT_MOUSE_JSB
380 "+mouse_jsbterm",
381# else
382 "-mouse_jsbterm",
383# endif
384# ifdef FEAT_MOUSE_NET
385 "+mouse_netterm",
386# else
387 "-mouse_netterm",
388# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000389#endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200390
Bram Moolenaar071d4272004-06-13 20:20:40 +0000391#ifdef __QNX__
392# ifdef FEAT_MOUSE_PTERM
393 "+mouse_pterm",
394# else
395 "-mouse_pterm",
396# endif
397#endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200398
399#if defined(UNIX) || defined(VMS)
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200400 "+mouse_sgr",
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200401# ifdef FEAT_SYSMOUSE
402 "+mouse_sysmouse",
403# else
404 "-mouse_sysmouse",
405# endif
406# ifdef FEAT_MOUSE_URXVT
407 "+mouse_urxvt",
408# else
409 "-mouse_urxvt",
410# endif
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200411 "+mouse_xterm",
Bram Moolenaar707cfb82012-10-21 04:00:07 +0200412#endif
413
Bram Moolenaar071d4272004-06-13 20:20:40 +0000414#ifdef FEAT_MBYTE_IME
415# ifdef DYNAMIC_IME
416 "+multi_byte_ime/dyn",
417# else
418 "+multi_byte_ime",
419# endif
420#else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000421 "+multi_byte",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000422#endif
423#ifdef FEAT_MULTI_LANG
424 "+multi_lang",
425#else
426 "-multi_lang",
427#endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000428#ifdef FEAT_MZSCHEME
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000429# ifdef DYNAMIC_MZSCHEME
430 "+mzscheme/dyn",
431# else
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000432 "+mzscheme",
Bram Moolenaardf3267e2005-01-25 22:07:05 +0000433# endif
Bram Moolenaar325b7a22004-07-05 15:58:32 +0000434#else
435 "-mzscheme",
436#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000437#ifdef FEAT_NETBEANS_INTG
438 "+netbeans_intg",
439#else
440 "-netbeans_intg",
441#endif
Bram Moolenaar22fcfad2016-07-01 18:17:26 +0200442 "+num64",
Bram Moolenaar4f974752019-02-17 17:44:42 +0100443#ifdef FEAT_GUI_MSWIN
Bram Moolenaar071d4272004-06-13 20:20:40 +0000444# ifdef FEAT_OLE
445 "+ole",
446# else
447 "-ole",
448# endif
449#endif
Bram Moolenaar6183ccb2018-07-22 05:08:11 +0200450#ifdef FEAT_EVAL
Bram Moolenaarf6fee0e2016-02-21 23:02:49 +0100451 "+packages",
Bram Moolenaar6183ccb2018-07-22 05:08:11 +0200452#else
453 "-packages",
454#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000455#ifdef FEAT_PATH_EXTRA
456 "+path_extra",
457#else
458 "-path_extra",
459#endif
460#ifdef FEAT_PERL
461# ifdef DYNAMIC_PERL
462 "+perl/dyn",
463# else
464 "+perl",
465# endif
466#else
467 "-perl",
468#endif
Bram Moolenaar55debbe2010-05-23 23:34:36 +0200469#ifdef FEAT_PERSISTENT_UNDO
470 "+persistent_undo",
471#else
472 "-persistent_undo",
473#endif
Bram Moolenaar05ad5ff2019-11-30 22:48:27 +0100474#ifdef FEAT_PROP_POPUP
475 "+popupwin",
476#else
477 "-popupwin",
478#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000479#ifdef FEAT_PRINTER
480# ifdef FEAT_POSTSCRIPT
481 "+postscript",
482# else
483 "-postscript",
484# endif
485 "+printer",
486#else
487 "-printer",
488#endif
Bram Moolenaar05159a02005-02-26 23:04:13 +0000489#ifdef FEAT_PROFILE
490 "+profile",
491#else
492 "-profile",
493#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000494#ifdef FEAT_PYTHON
495# ifdef DYNAMIC_PYTHON
496 "+python/dyn",
497# else
498 "+python",
499# endif
500#else
501 "-python",
502#endif
Bram Moolenaarbd5e15f2010-07-17 21:19:38 +0200503#ifdef FEAT_PYTHON3
504# ifdef DYNAMIC_PYTHON3
505 "+python3/dyn",
506# else
507 "+python3",
508# endif
509#else
510 "-python3",
511#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000512#ifdef FEAT_QUICKFIX
513 "+quickfix",
514#else
515 "-quickfix",
516#endif
Bram Moolenaard68071d2006-05-02 22:08:30 +0000517#ifdef FEAT_RELTIME
518 "+reltime",
519#else
520 "-reltime",
521#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000522#ifdef FEAT_RIGHTLEFT
523 "+rightleft",
524#else
525 "-rightleft",
526#endif
527#ifdef FEAT_RUBY
528# ifdef DYNAMIC_RUBY
529 "+ruby/dyn",
530# else
531 "+ruby",
532# endif
533#else
534 "-ruby",
535#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000536 "+scrollbind",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000537#ifdef FEAT_SIGNS
538 "+signs",
539#else
540 "-signs",
541#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000542 "+smartindent",
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200543#ifdef FEAT_SODIUM
K.Takatad68b2fc2022-02-12 11:18:37 +0000544# ifdef DYNAMIC_SODIUM
545 "+sodium/dyn",
546# else
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200547 "+sodium",
K.Takatad68b2fc2022-02-12 11:18:37 +0000548# endif
Christian Brabandtf573c6e2021-06-20 14:02:16 +0200549#else
550 "-sodium",
551#endif
Bram Moolenaar427f5b62019-06-09 13:43:51 +0200552#ifdef FEAT_SOUND
553 "+sound",
554#else
555 "-sound",
556#endif
557#ifdef FEAT_SPELL
558 "+spell",
559#else
560 "-spell",
561#endif
Bram Moolenaaref94eec2009-11-11 13:22:11 +0000562#ifdef STARTUPTIME
563 "+startuptime",
564#else
565 "-startuptime",
566#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000567#ifdef FEAT_STL_OPT
568 "+statusline",
569#else
570 "-statusline",
571#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000572 "-sun_workshop",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000573#ifdef FEAT_SYN_HL
574 "+syntax",
575#else
576 "-syntax",
577#endif
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +0100578 // only interesting on Unix systems
Bram Moolenaara06ecab2016-07-16 14:47:36 +0200579#if defined(USE_SYSTEM) && defined(UNIX)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000580 "+system()",
581#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000582 "+tag_binary",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000583 "-tag_old_static",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000584 "-tag_any_white",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000585#ifdef FEAT_TCL
586# ifdef DYNAMIC_TCL
587 "+tcl/dyn",
588# else
589 "+tcl",
590# endif
591#else
592 "-tcl",
593#endif
Bram Moolenaar61be73b2016-04-29 22:59:22 +0200594#ifdef FEAT_TERMGUICOLORS
595 "+termguicolors",
596#else
597 "-termguicolors",
598#endif
Bram Moolenaar26e85582017-07-15 20:05:54 +0200599#ifdef FEAT_TERMINAL
600 "+terminal",
601#else
602 "-terminal",
603#endif
Bram Moolenaara06ecab2016-07-16 14:47:36 +0200604#if defined(UNIX)
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +0100605// only Unix can have terminfo instead of termcap
Bram Moolenaar071d4272004-06-13 20:20:40 +0000606# ifdef TERMINFO
607 "+terminfo",
608# else
609 "-terminfo",
610# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000611#endif
612#ifdef FEAT_TERMRESPONSE
613 "+termresponse",
614#else
615 "-termresponse",
616#endif
617#ifdef FEAT_TEXTOBJ
618 "+textobjects",
619#else
620 "-textobjects",
621#endif
Bram Moolenaar05ad5ff2019-11-30 22:48:27 +0100622#ifdef FEAT_PROP_POPUP
Bram Moolenaar98aefe72018-12-13 22:20:09 +0100623 "+textprop",
624#else
625 "-textprop",
626#endif
627#if !defined(UNIX)
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +0100628// unix always includes termcap support
Bram Moolenaar98aefe72018-12-13 22:20:09 +0100629# ifdef HAVE_TGETENT
630 "+tgetent",
631# else
632 "-tgetent",
633# endif
634#endif
Bram Moolenaar975b5272016-03-15 23:10:59 +0100635#ifdef FEAT_TIMERS
636 "+timers",
637#else
638 "-timers",
639#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000640 "+title",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000641#ifdef FEAT_TOOLBAR
642 "+toolbar",
643#else
644 "-toolbar",
645#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000646 "+user_commands",
Bram Moolenaar04958cb2018-06-23 19:23:02 +0200647#ifdef FEAT_VARTABS
648 "+vartabs",
649#else
650 "-vartabs",
651#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000652 "+vertsplit",
Bram Moolenaara6feb162022-01-02 12:06:33 +0000653 "+vim9script",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000654#ifdef FEAT_VIMINFO
655 "+viminfo",
656#else
657 "-viminfo",
658#endif
Bram Moolenaara6feb162022-01-02 12:06:33 +0000659 "+virtualedit",
660 "+visual",
661 "+visualextra",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000662 "+vreplace",
Bram Moolenaar4f974752019-02-17 17:44:42 +0100663#ifdef MSWIN
Bram Moolenaarcafafb32018-02-22 21:07:09 +0100664# ifdef FEAT_VTP
665 "+vtp",
666# else
667 "-vtp",
668# endif
669#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000670#ifdef FEAT_WILDIGN
671 "+wildignore",
672#else
673 "-wildignore",
674#endif
675#ifdef FEAT_WILDMENU
676 "+wildmenu",
677#else
678 "-wildmenu",
679#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000680 "+windows",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000681#ifdef FEAT_WRITEBACKUP
682 "+writebackup",
683#else
684 "-writebackup",
685#endif
686#if defined(UNIX) || defined(VMS)
687# ifdef FEAT_X11
688 "+X11",
689# else
690 "-X11",
691# endif
692#endif
693#ifdef FEAT_XFONTSET
694 "+xfontset",
695#else
696 "-xfontset",
697#endif
698#ifdef FEAT_XIM
699 "+xim",
700#else
701 "-xim",
702#endif
ichizok02560422022-04-05 14:18:44 +0100703#if defined(MSWIN)
Bram Moolenaard58b0f92016-08-13 16:39:56 +0200704# ifdef FEAT_XPM_W32
705 "+xpm_w32",
706# else
707 "-xpm_w32",
708# endif
ichizok02560422022-04-05 14:18:44 +0100709#elif defined(HAVE_XPM)
Bram Moolenaard58b0f92016-08-13 16:39:56 +0200710 "+xpm",
ichizok02560422022-04-05 14:18:44 +0100711#else
Bram Moolenaard58b0f92016-08-13 16:39:56 +0200712 "-xpm",
Bram Moolenaard58b0f92016-08-13 16:39:56 +0200713#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000714#if defined(UNIX) || defined(VMS)
ichizok02560422022-04-05 14:18:44 +0100715# if defined(USE_XSMP_INTERACT)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000716 "+xsmp_interact",
ichizok02560422022-04-05 14:18:44 +0100717# elif defined(USE_XSMP)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000718 "+xsmp",
ichizok02560422022-04-05 14:18:44 +0100719# else
Bram Moolenaar071d4272004-06-13 20:20:40 +0000720 "-xsmp",
Bram Moolenaar071d4272004-06-13 20:20:40 +0000721# endif
722# ifdef FEAT_XCLIPBOARD
723 "+xterm_clipboard",
724# else
725 "-xterm_clipboard",
726# endif
727#endif
728#ifdef FEAT_XTERM_SAVE
729 "+xterm_save",
730#else
731 "-xterm_save",
732#endif
Bram Moolenaar071d4272004-06-13 20:20:40 +0000733 NULL
734};
735
736static int included_patches[] =
737{ /* Add new patch number below this line */
738/**/
Anton Sharonov6b568b12022-07-31 12:26:05 +0100739 120,
740/**/
K.Takatadbdcc792022-07-31 11:50:42 +0100741 119,
742/**/
zeertzjq75020942022-07-31 11:37:20 +0100743 118,
744/**/
Bram Moolenaar3a4cd392022-07-30 22:17:18 +0100745 117,
746/**/
Bram Moolenaar711483c2022-07-30 21:33:46 +0100747 116,
748/**/
Bram Moolenaar6747cf12022-07-30 19:10:06 +0100749 115,
750/**/
Shougo Matsushitaf39cfb72022-07-30 16:54:05 +0100751 114,
752/**/
K.Takatad90f91f2022-07-30 15:43:59 +0100753 113,
754/**/
Bram Moolenaar0f823c32022-07-30 15:35:12 +0100755 112,
756/**/
Bram Moolenaarde786322022-07-30 14:56:17 +0100757 111,
758/**/
Carlo Teubnerddab3ce2022-07-30 12:03:16 +0100759 110,
760/**/
Bram Moolenaar1eead4c2022-07-30 11:39:57 +0100761 109,
762/**/
Bram Moolenaar5f6cae82022-07-30 11:00:50 +0100763 108,
764/**/
Bram Moolenaar72981ac2022-07-29 19:50:41 +0100765 107,
766/**/
Bram Moolenaarcb36c2a2022-07-29 18:32:20 +0100767 106,
768/**/
Bram Moolenaarf5094052022-07-29 16:22:25 +0100769 105,
770/**/
Bram Moolenaar1e56bda2022-07-29 15:28:27 +0100771 104,
772/**/
Bram Moolenaarefffa532022-07-28 22:39:54 +0100773 103,
774/**/
Bram Moolenaara6f9e302022-07-28 21:51:37 +0100775 102,
776/**/
Bram Moolenaar4e677b92022-07-28 18:44:27 +0100777 101,
778/**/
Bram Moolenaarcb5ed4d2022-07-28 12:54:08 +0100779 100,
780/**/
zeertzjq46af7bc2022-07-28 12:34:09 +0100781 99,
782/**/
Bram Moolenaar5748b7f2022-07-28 12:09:04 +0100783 98,
784/**/
Bram Moolenaar5f30e262022-07-28 11:56:01 +0100785 97,
786/**/
zeertzjqf6782732022-07-27 18:26:03 +0100787 96,
788/**/
zeertzjq122dea72022-07-27 15:48:45 +0100789 95,
790/**/
Bram Moolenaar3d6ee8b2022-07-27 15:23:35 +0100791 94,
792/**/
James Eapen7abd1c62022-07-27 15:07:06 +0100793 93,
794/**/
Shougo Matsushita61021aa2022-07-27 14:40:00 +0100795 92,
796/**/
Bram Moolenaar34d17732022-07-27 13:18:14 +0100797 91,
798/**/
Bram Moolenaar28f84e12022-07-27 12:30:13 +0100799 90,
800/**/
Yegappan Lakshmanan7db3a8e2022-07-26 22:01:36 +0100801 89,
802/**/
Gregory Anders30e212d2022-07-26 21:42:03 +0100803 88,
804/**/
Anton Sharonov3f026672022-07-26 21:26:18 +0100805 87,
806/**/
zeertzjq6791adc2022-07-26 20:42:25 +0100807 86,
808/**/
ii141f0dc5e2022-07-26 19:44:56 +0100809 85,
810/**/
Bram Moolenaar15b87b62022-07-26 19:18:28 +0100811 84,
812/**/
zeertzjqc9e8fd62022-07-26 18:12:38 +0100813 83,
814/**/
zeertzjq3cfae392022-07-26 17:48:13 +0100815 82,
816/**/
Bram Moolenaarc2842ad2022-07-26 17:23:47 +0100817 81,
818/**/
Mike Williams04947892022-07-26 16:03:42 +0100819 80,
820/**/
Bram Moolenaar6809ff92022-07-26 15:10:56 +0100821 79,
822/**/
Ernie Rael559f2302022-07-26 14:44:36 +0100823 78,
824/**/
Bram Moolenaarb03950f2022-07-26 13:47:13 +0100825 77,
826/**/
zeertzjq92a16782022-07-26 12:24:41 +0100827 76,
828/**/
Bram Moolenaarbe3dbda2022-07-26 11:42:34 +0100829 75,
830/**/
Bram Moolenaar34a1f772022-07-26 11:20:48 +0100831 74,
832/**/
Martin Tournoij1b67f072022-07-25 21:40:06 +0100833 73,
834/**/
Bram Moolenaar6d023f92022-07-25 21:15:45 +0100835 72,
836/**/
zeertzjqecdc82e2022-07-25 19:50:57 +0100837 71,
838/**/
zeertzjq4dc513a2022-07-25 19:42:02 +0100839 70,
840/**/
Bram Moolenaar0c740e72022-07-25 19:07:04 +0100841 69,
842/**/
Bram Moolenaarfe3fb6e2022-07-25 18:35:15 +0100843 68,
844/**/
Bram Moolenaar7f9969c2022-07-25 18:13:54 +0100845 67,
846/**/
zeertzjqcd6ad642022-07-25 12:28:09 +0100847 66,
848/**/
Richard Purdie509695c2022-07-24 20:48:00 +0100849 65,
850/**/
Bram Moolenaarc963ec32022-07-24 20:08:01 +0100851 64,
852/**/
Bram Moolenaard61efa52022-07-23 09:52:04 +0100853 63,
854/**/
Bram Moolenaar5ac50de2022-07-23 09:22:47 +0100855 62,
856/**/
Bram Moolenaar5fa9f232022-07-23 09:06:48 +0100857 61,
858/**/
Bram Moolenaarb9e71732022-07-23 06:53:08 +0100859 60,
860/**/
zeertzjqbb404f52022-07-23 06:25:29 +0100861 59,
862/**/
Yegappan Lakshmanan81a3ff92022-07-23 05:04:16 +0100863 58,
864/**/
Bram Moolenaar5154a882022-07-18 20:48:50 +0100865 57,
866/**/
Bram Moolenaarbd683e32022-07-18 17:49:03 +0100867 56,
868/**/
Gregory Andersfa49eb42022-07-16 17:46:47 +0100869 55,
870/**/
Bram Moolenaarc7bd2f02022-07-15 20:45:20 +0100871 54,
872/**/
Dominique Pelle3a393792022-07-14 17:40:49 +0100873 53,
874/**/
K.Takata2ebcc352022-07-14 17:25:14 +0100875 52,
876/**/
zeertzjqf754fe62022-07-14 17:06:12 +0100877 51,
878/**/
Bram Moolenaarb26592a2022-07-12 17:34:31 +0100879 50,
880/**/
Leandro Lourenci99af91e2022-07-09 20:27:07 +0100881 49,
882/**/
Bram Moolenaarb9081882022-07-09 04:56:24 +0100883 48,
884/**/
Bram Moolenaar32acf1f2022-07-07 22:20:31 +0100885 47,
886/**/
Bram Moolenaarbaefde12022-07-07 19:59:49 +0100887 46,
888/**/
Bram Moolenaarcaea6642022-07-07 19:42:04 +0100889 45,
890/**/
Bram Moolenaarb8329db2022-07-06 13:31:28 +0100891 44,
892/**/
zeertzjqcf344342022-07-06 12:57:31 +0100893 43,
894/**/
Bram Moolenaar32447802022-07-05 21:56:39 +0100895 42,
896/**/
smjonas704988f2022-07-05 18:42:56 +0100897 41,
898/**/
Bram Moolenaarb67f0c82022-07-04 21:03:36 +0100899 40,
900/**/
Bram Moolenaar4c99e622022-07-04 19:58:17 +0100901 39,
902/**/
Bram Moolenaar5ed26fa2022-07-04 18:05:51 +0100903 38,
904/**/
Bram Moolenaar510f0372022-07-04 17:46:22 +0100905 37,
906/**/
Bram Moolenaar96ba25a2022-07-04 17:34:33 +0100907 36,
908/**/
Bram Moolenaar54e5fed2022-07-04 13:37:07 +0100909 35,
910/**/
zeertzjq288ed232022-07-04 11:03:07 +0100911 34,
912/**/
Anton Sharonov4dd92522022-07-04 10:47:31 +0100913 33,
914/**/
Bram Moolenaar7fe956d2022-07-03 14:21:09 +0100915 32,
916/**/
zeertzjq9359e8a2022-07-03 13:16:09 +0100917 31,
918/**/
Bram Moolenaar22e7e862022-07-02 20:48:01 +0100919 30,
920/**/
Bram Moolenaardaaca8a2022-07-02 17:58:23 +0100921 29,
922/**/
Bram Moolenaar022f9ef2022-07-02 17:36:31 +0100923 28,
924/**/
Bram Moolenaar2d295012022-07-02 16:29:34 +0100925 27,
926/**/
Bram Moolenaarc5274dd2022-07-02 15:10:00 +0100927 26,
928/**/
Bram Moolenaarc6fdb152022-07-02 13:43:21 +0100929 25,
930/**/
Bram Moolenaaraf043e12022-07-02 12:08:16 +0100931 24,
932/**/
Bram Moolenaarf2ce76a2022-07-02 11:40:40 +0100933 23,
934/**/
Bram Moolenaar95afae62022-07-01 22:44:19 +0100935 22,
936/**/
Bram Moolenaar5e59ea52022-07-01 22:26:20 +0100937 21,
938/**/
Bram Moolenaarf12129f2022-07-01 19:58:30 +0100939 20,
940/**/
zeertzjqeb273cd2022-07-01 19:11:23 +0100941 19,
942/**/
Bram Moolenaar27efc622022-07-01 16:35:45 +0100943 18,
944/**/
Bram Moolenaar3d51ce12022-07-01 15:26:15 +0100945 17,
946/**/
Bram Moolenaarc2a79b82022-07-01 13:15:35 +0100947 16,
948/**/
zeertzjq79ae1522022-07-01 12:13:15 +0100949 15,
950/**/
Bram Moolenaar9610f942022-06-30 22:28:08 +0100951 14,
952/**/
Bram Moolenaarfa4873c2022-06-30 22:13:59 +0100953 13,
954/**/
Bram Moolenaarcdbfc6d2022-06-30 16:25:21 +0100955 12,
956/**/
Bram Moolenaard25f0032022-06-30 12:30:19 +0100957 11,
958/**/
Bram Moolenaarb0375d42022-06-30 11:03:39 +0100959 10,
960/**/
Bram Moolenaar083692d2022-06-29 21:16:58 +0100961 9,
962/**/
David Gow83e11802022-06-29 20:24:49 +0100963 8,
964/**/
Bram Moolenaar84f54632022-06-29 18:39:11 +0100965 7,
966/**/
Bram Moolenaar8b5901e2022-06-29 14:39:12 +0100967 6,
968/**/
Hugo Osvaldo Barrera04067412022-06-29 13:48:49 +0100969 5,
970/**/
Matvey Tarasovd14bb1a2022-06-29 13:18:27 +0100971 4,
972/**/
Yegappan Lakshmananee47eac2022-06-29 12:55:36 +0100973 3,
974/**/
zeertzjqc207fd22022-06-29 10:37:40 +0100975 2,
976/**/
Bram Moolenaar75417d92022-06-28 20:07:42 +0100977 1,
978/**/
Bram Moolenaar071d4272004-06-13 20:20:40 +0000979 0
980};
981
Bram Moolenaar10d4cec2008-11-30 11:15:09 +0000982/*
983 * Place to put a short description when adding a feature with a patch.
984 * Keep it short, e.g.,: "relative numbers", "persistent undo".
985 * Also add a comment marker to separate the lines.
986 * See the official Vim patches for the diff format: It must use a context of
Bram Moolenaarcbb8eb32008-12-24 13:25:14 +0000987 * one line only. Create it by hand or use "diff -C2" and edit the patch.
Bram Moolenaar10d4cec2008-11-30 11:15:09 +0000988 */
989static char *(extra_patches[]) =
990{ /* Add your patch description below this line */
991/**/
992 NULL
993};
994
Bram Moolenaar071d4272004-06-13 20:20:40 +0000995 int
Bram Moolenaarb638a7b2016-01-30 21:29:58 +0100996highest_patch(void)
Bram Moolenaar071d4272004-06-13 20:20:40 +0000997{
Bram Moolenaar37df9a42019-06-14 14:39:51 +0200998 // this relies on the highest patch number to be the first entry
999 return included_patches[0];
Bram Moolenaar071d4272004-06-13 20:20:40 +00001000}
1001
1002#if defined(FEAT_EVAL) || defined(PROTO)
1003/*
1004 * Return TRUE if patch "n" has been included.
1005 */
1006 int
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001007has_patch(int n)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001008{
Bram Moolenaar232f4612020-11-10 20:54:29 +01001009 int h, m, l;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001010
Bram Moolenaar232f4612020-11-10 20:54:29 +01001011 // Perform a binary search.
1012 l = 0;
K.Takataeeec2542021-06-02 13:28:16 +02001013 h = (int)ARRAY_LENGTH(included_patches) - 1;
Bram Moolenaarb0375d42022-06-30 11:03:39 +01001014 for (;;)
Bram Moolenaar232f4612020-11-10 20:54:29 +01001015 {
1016 m = (l + h) / 2;
1017 if (included_patches[m] == n)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001018 return TRUE;
Bram Moolenaarb0375d42022-06-30 11:03:39 +01001019 if (l == h)
1020 break;
Bram Moolenaar232f4612020-11-10 20:54:29 +01001021 if (included_patches[m] < n)
1022 h = m;
1023 else
1024 l = m + 1;
1025 }
Bram Moolenaar071d4272004-06-13 20:20:40 +00001026 return FALSE;
1027}
1028#endif
1029
1030 void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001031ex_version(exarg_T *eap)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001032{
1033 /*
1034 * Ignore a ":version 9.99" command.
1035 */
1036 if (*eap->arg == NUL)
1037 {
1038 msg_putchar('\n');
1039 list_version();
1040 }
1041}
1042
Bram Moolenaar445f3032013-02-20 16:47:36 +01001043/*
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001044 * Output a string for the version message. If it's going to wrap, output a
1045 * newline, unless the message is too long to fit on the screen anyway.
1046 * When "wrap" is TRUE wrap the string in [].
1047 */
1048 static void
1049version_msg_wrap(char_u *s, int wrap)
1050{
=?UTF-8?q?Dundar=20G=C3=B6c?=dfa5e462021-10-02 11:26:51 +01001051 int len = vim_strsize(s) + (wrap ? 2 : 0);
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001052
1053 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1054 && *s != '\n')
1055 msg_putchar('\n');
1056 if (!got_int)
1057 {
1058 if (wrap)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001059 msg_puts("[");
1060 msg_puts((char *)s);
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001061 if (wrap)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001062 msg_puts("]");
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001063 }
1064}
1065
1066 static void
1067version_msg(char *s)
1068{
1069 version_msg_wrap((char_u *)s, FALSE);
1070}
1071
1072/*
Bram Moolenaar445f3032013-02-20 16:47:36 +01001073 * List all features aligned in columns, dictionary style.
1074 */
1075 static void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001076list_features(void)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001077{
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001078 list_in_columns((char_u **)features, -1, -1);
1079}
1080
1081/*
1082 * List string items nicely aligned in columns.
1083 * When "size" is < 0 then the last entry is marked with NULL.
1084 * The entry with index "current" is inclosed in [].
1085 */
1086 void
1087list_in_columns(char_u **items, int size, int current)
1088{
Bram Moolenaar445f3032013-02-20 16:47:36 +01001089 int i;
1090 int ncol;
1091 int nrow;
Bram Moolenaar949f1982019-07-23 23:00:08 +02001092 int cur_row = 1;
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001093 int item_count = 0;
Bram Moolenaar445f3032013-02-20 16:47:36 +01001094 int width = 0;
Bram Moolenaarc85ffc92019-01-02 17:26:35 +01001095#ifdef FEAT_SYN_HL
1096 int use_highlight = (items == (char_u **)features);
1097#endif
Bram Moolenaar445f3032013-02-20 16:47:36 +01001098
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001099 // Find the length of the longest item, use that + 1 as the column
1100 // width.
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001101 for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001102 {
=?UTF-8?q?Dundar=20G=C3=B6c?=dfa5e462021-10-02 11:26:51 +01001103 int l = vim_strsize(items[i]) + (i == current ? 2 : 0);
Bram Moolenaar445f3032013-02-20 16:47:36 +01001104
1105 if (l > width)
1106 width = l;
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001107 ++item_count;
Bram Moolenaar445f3032013-02-20 16:47:36 +01001108 }
1109 width += 1;
1110
1111 if (Columns < width)
1112 {
Bram Moolenaar9800bfe2019-07-27 21:23:45 +02001113 // Not enough screen columns - show one per line
Bram Moolenaare961cba2018-09-18 21:51:47 +02001114 for (i = 0; i < item_count; ++i)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001115 {
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001116 version_msg_wrap(items[i], i == current);
Bram Moolenaar9800bfe2019-07-27 21:23:45 +02001117 if (msg_col > 0 && i < item_count - 1)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001118 msg_putchar('\n');
1119 }
1120 return;
1121 }
1122
Bram Moolenaar949f1982019-07-23 23:00:08 +02001123 // The rightmost column doesn't need a separator.
1124 // Sacrifice it to fit in one more column if possible.
Bram Moolenaarf13f45d2013-02-26 15:27:23 +01001125 ncol = (int) (Columns + 1) / width;
K.Takata54119102022-02-03 13:33:03 +00001126 nrow = item_count / ncol + ((item_count % ncol) ? 1 : 0);
Bram Moolenaar445f3032013-02-20 16:47:36 +01001127
Bram Moolenaar9800bfe2019-07-27 21:23:45 +02001128 // "i" counts columns then rows. "idx" counts rows then columns.
Bram Moolenaar445f3032013-02-20 16:47:36 +01001129 for (i = 0; !got_int && i < nrow * ncol; ++i)
1130 {
1131 int idx = (i / ncol) + (i % ncol) * nrow;
1132
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001133 if (idx < item_count)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001134 {
1135 int last_col = (i + 1) % ncol == 0;
1136
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001137 if (idx == current)
1138 msg_putchar('[');
Bram Moolenaarc85ffc92019-01-02 17:26:35 +01001139#ifdef FEAT_SYN_HL
1140 if (use_highlight && items[idx][0] == '-')
Bram Moolenaar32526b32019-01-19 17:43:09 +01001141 msg_puts_attr((char *)items[idx], HL_ATTR(HLF_W));
Bram Moolenaarc85ffc92019-01-02 17:26:35 +01001142 else
1143#endif
Bram Moolenaar32526b32019-01-19 17:43:09 +01001144 msg_puts((char *)items[idx]);
Bram Moolenaar5d69da42018-04-20 22:01:41 +02001145 if (idx == current)
1146 msg_putchar(']');
Bram Moolenaar445f3032013-02-20 16:47:36 +01001147 if (last_col)
1148 {
Bram Moolenaar949f1982019-07-23 23:00:08 +02001149 if (msg_col > 0 && cur_row < nrow)
Bram Moolenaar445f3032013-02-20 16:47:36 +01001150 msg_putchar('\n');
Bram Moolenaar949f1982019-07-23 23:00:08 +02001151 ++cur_row;
Bram Moolenaar445f3032013-02-20 16:47:36 +01001152 }
1153 else
1154 {
1155 while (msg_col % width)
1156 msg_putchar(' ');
1157 }
1158 }
Bram Moolenaar74da3932019-07-25 21:52:39 +02001159 else
1160 {
1161 // this row is out of items, thus at the end of the row
Bram Moolenaar9800bfe2019-07-27 21:23:45 +02001162 if (msg_col > 0)
1163 {
1164 if (cur_row < nrow)
1165 msg_putchar('\n');
1166 ++cur_row;
1167 }
Bram Moolenaar74da3932019-07-25 21:52:39 +02001168 }
Bram Moolenaar445f3032013-02-20 16:47:36 +01001169 }
1170}
Bram Moolenaar5c962632013-02-26 11:25:33 +01001171
Bram Moolenaar071d4272004-06-13 20:20:40 +00001172 void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001173list_version(void)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001174{
1175 int i;
1176 int first;
1177 char *s = "";
1178
1179 /*
1180 * When adding features here, don't forget to update the list of
1181 * internal variables in eval.c!
1182 */
Bram Moolenaar35fb6fb2018-06-23 16:12:21 +02001183 init_longVersion();
Bram Moolenaar32526b32019-01-19 17:43:09 +01001184 msg(longVersion);
Bram Moolenaar4f974752019-02-17 17:44:42 +01001185#ifdef MSWIN
1186# ifdef FEAT_GUI_MSWIN
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001187# ifdef VIMDLL
1188# ifdef _WIN64
1189 msg_puts(_("\nMS-Windows 64-bit GUI/console version"));
1190# else
1191 msg_puts(_("\nMS-Windows 32-bit GUI/console version"));
1192# endif
Bram Moolenaarcea912a2016-10-12 14:20:24 +02001193# else
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001194# ifdef _WIN64
1195 msg_puts(_("\nMS-Windows 64-bit GUI version"));
1196# else
Bram Moolenaar32526b32019-01-19 17:43:09 +01001197 msg_puts(_("\nMS-Windows 32-bit GUI version"));
Bram Moolenaarafde13b2019-04-28 19:46:49 +02001198# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001199# endif
Bram Moolenaar4f974752019-02-17 17:44:42 +01001200# ifdef FEAT_OLE
Bram Moolenaar32526b32019-01-19 17:43:09 +01001201 msg_puts(_(" with OLE support"));
Bram Moolenaar4f974752019-02-17 17:44:42 +01001202# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001203# else
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +00001204# ifdef _WIN64
Bram Moolenaar32526b32019-01-19 17:43:09 +01001205 msg_puts(_("\nMS-Windows 64-bit console version"));
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +00001206# else
Bram Moolenaar32526b32019-01-19 17:43:09 +01001207 msg_puts(_("\nMS-Windows 32-bit console version"));
Bram Moolenaare7cb9cf2008-06-20 14:32:41 +00001208# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001209# endif
1210#endif
Bram Moolenaard0573012017-10-28 21:11:06 +02001211#if defined(MACOS_X)
1212# if defined(MACOS_X_DARWIN)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001213 msg_puts(_("\nmacOS version"));
Bram Moolenaard0573012017-10-28 21:11:06 +02001214# else
Bram Moolenaar32526b32019-01-19 17:43:09 +01001215 msg_puts(_("\nmacOS version w/o darwin feat."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001216# endif
Bram Moolenaar8c9d98a2020-12-21 13:05:57 +01001217# if defined(__arm64__)
1218 msg_puts(" - arm64");
1219# elif defined(__x86_64__)
1220 msg_puts(" - x86_64");
1221# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +00001222#endif
1223
Bram Moolenaar071d4272004-06-13 20:20:40 +00001224#ifdef VMS
Bram Moolenaar32526b32019-01-19 17:43:09 +01001225 msg_puts(_("\nOpenVMS version"));
Bram Moolenaar3d20ca12006-11-28 16:43:58 +00001226# ifdef HAVE_PATHDEF
1227 if (*compiled_arch != NUL)
1228 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001229 msg_puts(" - ");
1230 msg_puts((char *)compiled_arch);
Bram Moolenaar3d20ca12006-11-28 16:43:58 +00001231 }
1232# endif
1233
Bram Moolenaar071d4272004-06-13 20:20:40 +00001234#endif
1235
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001236 // Print the list of patch numbers if there is at least one.
1237 // Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001238 if (included_patches[0] != 0)
1239 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001240 msg_puts(_("\nIncluded patches: "));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001241 first = -1;
K.Takataeeec2542021-06-02 13:28:16 +02001242 i = (int)ARRAY_LENGTH(included_patches) - 1;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001243 while (--i >= 0)
1244 {
1245 if (first < 0)
1246 first = included_patches[i];
1247 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1248 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001249 msg_puts(s);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001250 s = ", ";
1251 msg_outnum((long)first);
1252 if (first != included_patches[i])
1253 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001254 msg_puts("-");
Bram Moolenaar071d4272004-06-13 20:20:40 +00001255 msg_outnum((long)included_patches[i]);
1256 }
1257 first = -1;
1258 }
1259 }
1260 }
1261
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001262 // Print the list of extra patch descriptions if there is at least one.
Bram Moolenaar10d4cec2008-11-30 11:15:09 +00001263 if (extra_patches[0] != NULL)
1264 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001265 msg_puts(_("\nExtra patches: "));
Bram Moolenaar10d4cec2008-11-30 11:15:09 +00001266 s = "";
1267 for (i = 0; extra_patches[i] != NULL; ++i)
1268 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001269 msg_puts(s);
Bram Moolenaar10d4cec2008-11-30 11:15:09 +00001270 s = ", ";
Bram Moolenaar32526b32019-01-19 17:43:09 +01001271 msg_puts(extra_patches[i]);
Bram Moolenaar10d4cec2008-11-30 11:15:09 +00001272 }
1273 }
1274
Bram Moolenaar071d4272004-06-13 20:20:40 +00001275#ifdef MODIFIED_BY
Bram Moolenaar32526b32019-01-19 17:43:09 +01001276 msg_puts("\n");
1277 msg_puts(_("Modified by "));
1278 msg_puts(MODIFIED_BY);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001279#endif
1280
1281#ifdef HAVE_PATHDEF
1282 if (*compiled_user != NUL || *compiled_sys != NUL)
1283 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001284 msg_puts(_("\nCompiled "));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001285 if (*compiled_user != NUL)
1286 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001287 msg_puts(_("by "));
1288 msg_puts((char *)compiled_user);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001289 }
1290 if (*compiled_sys != NUL)
1291 {
Bram Moolenaar32526b32019-01-19 17:43:09 +01001292 msg_puts("@");
1293 msg_puts((char *)compiled_sys);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001294 }
1295 }
1296#endif
1297
ichizok02560422022-04-05 14:18:44 +01001298#if defined(FEAT_HUGE)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001299 msg_puts(_("\nHuge version "));
ichizok02560422022-04-05 14:18:44 +01001300#elif defined(FEAT_BIG)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001301 msg_puts(_("\nBig version "));
ichizok02560422022-04-05 14:18:44 +01001302#elif defined(FEAT_NORMAL)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001303 msg_puts(_("\nNormal version "));
ichizok02560422022-04-05 14:18:44 +01001304#elif defined(FEAT_SMALL)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001305 msg_puts(_("\nSmall version "));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001306#else
ichizok02560422022-04-05 14:18:44 +01001307 msg_puts(_("\nTiny version "));
1308#endif
1309#if !defined(FEAT_GUI)
1310 msg_puts(_("without GUI."));
1311#elif defined(FEAT_GUI_GTK)
1312# if defined(USE_GTK3)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001313 msg_puts(_("with GTK3 GUI."));
ichizok02560422022-04-05 14:18:44 +01001314# elif defined(FEAT_GUI_GNOME)
Bram Moolenaar32526b32019-01-19 17:43:09 +01001315 msg_puts(_("with GTK2-GNOME GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001316# else
ichizok02560422022-04-05 14:18:44 +01001317 msg_puts(_("with GTK2 GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001318# endif
ichizok02560422022-04-05 14:18:44 +01001319#elif defined(FEAT_GUI_MOTIF)
1320 msg_puts(_("with X11-Motif GUI."));
1321#elif defined(FEAT_GUI_HAIKU)
1322 msg_puts(_("with Haiku GUI."));
1323#elif defined(FEAT_GUI_PHOTON)
1324 msg_puts(_("with Photon GUI."));
1325#elif defined(MSWIN)
1326 msg_puts(_("with GUI."));
Bram Moolenaar071d4272004-06-13 20:20:40 +00001327#endif
1328 version_msg(_(" Features included (+) or not (-):\n"));
1329
Bram Moolenaar445f3032013-02-20 16:47:36 +01001330 list_features();
Bram Moolenaar8a5c29a2019-07-26 19:48:19 +02001331 if (msg_col > 0)
1332 msg_putchar('\n');
Bram Moolenaar071d4272004-06-13 20:20:40 +00001333
Bram Moolenaar071d4272004-06-13 20:20:40 +00001334#ifdef SYS_VIMRC_FILE
1335 version_msg(_(" system vimrc file: \""));
1336 version_msg(SYS_VIMRC_FILE);
1337 version_msg("\"\n");
1338#endif
1339#ifdef USR_VIMRC_FILE
1340 version_msg(_(" user vimrc file: \""));
1341 version_msg(USR_VIMRC_FILE);
1342 version_msg("\"\n");
1343#endif
1344#ifdef USR_VIMRC_FILE2
1345 version_msg(_(" 2nd user vimrc file: \""));
1346 version_msg(USR_VIMRC_FILE2);
1347 version_msg("\"\n");
1348#endif
1349#ifdef USR_VIMRC_FILE3
1350 version_msg(_(" 3rd user vimrc file: \""));
1351 version_msg(USR_VIMRC_FILE3);
1352 version_msg("\"\n");
1353#endif
1354#ifdef USR_EXRC_FILE
1355 version_msg(_(" user exrc file: \""));
1356 version_msg(USR_EXRC_FILE);
1357 version_msg("\"\n");
1358#endif
1359#ifdef USR_EXRC_FILE2
1360 version_msg(_(" 2nd user exrc file: \""));
1361 version_msg(USR_EXRC_FILE2);
1362 version_msg("\"\n");
1363#endif
1364#ifdef FEAT_GUI
1365# ifdef SYS_GVIMRC_FILE
1366 version_msg(_(" system gvimrc file: \""));
1367 version_msg(SYS_GVIMRC_FILE);
1368 version_msg("\"\n");
1369# endif
1370 version_msg(_(" user gvimrc file: \""));
1371 version_msg(USR_GVIMRC_FILE);
1372 version_msg("\"\n");
1373# ifdef USR_GVIMRC_FILE2
1374 version_msg(_("2nd user gvimrc file: \""));
1375 version_msg(USR_GVIMRC_FILE2);
1376 version_msg("\"\n");
1377# endif
1378# ifdef USR_GVIMRC_FILE3
1379 version_msg(_("3rd user gvimrc file: \""));
1380 version_msg(USR_GVIMRC_FILE3);
1381 version_msg("\"\n");
1382# endif
1383#endif
Bram Moolenaar8c08b5b2016-07-28 22:24:15 +02001384 version_msg(_(" defaults file: \""));
1385 version_msg(VIM_DEFAULTS_FILE);
1386 version_msg("\"\n");
Bram Moolenaar071d4272004-06-13 20:20:40 +00001387#ifdef FEAT_GUI
1388# ifdef SYS_MENU_FILE
1389 version_msg(_(" system menu file: \""));
1390 version_msg(SYS_MENU_FILE);
1391 version_msg("\"\n");
1392# endif
1393#endif
1394#ifdef HAVE_PATHDEF
1395 if (*default_vim_dir != NUL)
1396 {
1397 version_msg(_(" fall-back for $VIM: \""));
1398 version_msg((char *)default_vim_dir);
1399 version_msg("\"\n");
1400 }
1401 if (*default_vimruntime_dir != NUL)
1402 {
1403 version_msg(_(" f-b for $VIMRUNTIME: \""));
1404 version_msg((char *)default_vimruntime_dir);
1405 version_msg("\"\n");
1406 }
1407 version_msg(_("Compilation: "));
1408 version_msg((char *)all_cflags);
1409 version_msg("\n");
1410#ifdef VMS
1411 if (*compiler_version != NUL)
1412 {
1413 version_msg(_("Compiler: "));
1414 version_msg((char *)compiler_version);
1415 version_msg("\n");
1416 }
1417#endif
1418 version_msg(_("Linking: "));
1419 version_msg((char *)all_lflags);
1420#endif
1421#ifdef DEBUG
1422 version_msg("\n");
1423 version_msg(_(" DEBUG BUILD"));
1424#endif
1425}
1426
Bram Moolenaarbaaa7e92016-01-29 22:47:03 +01001427static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
Bram Moolenaarbdff0122020-04-05 18:56:05 +02001428static void intro_message(int colon);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001429
1430/*
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001431 * Show the intro message when not editing a file.
1432 */
1433 void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001434maybe_intro_message(void)
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001435{
Bram Moolenaarb5aedf32017-03-12 18:23:53 +01001436 if (BUFEMPTY()
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001437 && curbuf->b_fname == NULL
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001438 && firstwin->w_next == NULL
Bram Moolenaar249f0dd2013-07-04 22:31:03 +02001439 && vim_strchr(p_shm, SHM_INTRO) == NULL)
1440 intro_message(FALSE);
1441}
1442
1443/*
Bram Moolenaar071d4272004-06-13 20:20:40 +00001444 * Give an introductory message about Vim.
1445 * Only used when starting Vim on an empty file, without a file name.
1446 * Or with the ":intro" command (for Sven :-).
1447 */
Bram Moolenaarbdff0122020-04-05 18:56:05 +02001448 static void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001449intro_message(
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001450 int colon) // TRUE for ":intro"
Bram Moolenaar071d4272004-06-13 20:20:40 +00001451{
1452 int i;
1453 int row;
1454 int blanklines;
1455 int sponsor;
1456 char *p;
1457 static char *(lines[]) =
1458 {
1459 N_("VIM - Vi IMproved"),
1460 "",
1461 N_("version "),
1462 N_("by Bram Moolenaar et al."),
1463#ifdef MODIFIED_BY
1464 " ",
1465#endif
1466 N_("Vim is open source and freely distributable"),
1467 "",
1468 N_("Help poor children in Uganda!"),
1469 N_("type :help iccf<Enter> for information "),
1470 "",
1471 N_("type :q<Enter> to exit "),
1472 N_("type :help<Enter> or <F1> for on-line help"),
Bram Moolenaarabd56da2022-06-23 20:46:27 +01001473 N_("type :help version9<Enter> for version info"),
Bram Moolenaar071d4272004-06-13 20:20:40 +00001474 NULL,
1475 "",
1476 N_("Running in Vi compatible mode"),
1477 N_("type :set nocp<Enter> for Vim defaults"),
1478 N_("type :help cp-default<Enter> for info on this"),
1479 };
1480#ifdef FEAT_GUI
1481 static char *(gui_lines[]) =
1482 {
1483 NULL,
1484 NULL,
1485 NULL,
1486 NULL,
1487#ifdef MODIFIED_BY
1488 NULL,
1489#endif
1490 NULL,
1491 NULL,
1492 NULL,
1493 N_("menu Help->Orphans for information "),
1494 NULL,
1495 N_("Running modeless, typed text is inserted"),
1496 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1497 N_(" for two modes "),
1498 NULL,
1499 NULL,
1500 NULL,
1501 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1502 N_(" for Vim defaults "),
1503 };
1504#endif
1505
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001506 // blanklines = screen height - # message lines
K.Takataeeec2542021-06-02 13:28:16 +02001507 blanklines = (int)Rows - (ARRAY_LENGTH(lines) - 1);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001508 if (!p_cp)
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001509 blanklines += 4; // add 4 for not showing "Vi compatible" message
Bram Moolenaar071d4272004-06-13 20:20:40 +00001510
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001511 // Don't overwrite a statusline. Depends on 'cmdheight'.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001512 if (p_ls > 1)
1513 blanklines -= Rows - topframe->fr_height;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001514 if (blanklines < 0)
1515 blanklines = 0;
1516
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001517 // Show the sponsor and register message one out of four times, the Uganda
1518 // message two out of four times.
Bram Moolenaarf4cd3e82005-12-22 22:47:02 +00001519 sponsor = (int)time(NULL);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001520 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1521
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001522 // start displaying the message lines after half of the blank lines
Bram Moolenaar071d4272004-06-13 20:20:40 +00001523 row = blanklines / 2;
1524 if ((row >= 2 && Columns >= 50) || colon)
1525 {
K.Takataeeec2542021-06-02 13:28:16 +02001526 for (i = 0; i < (int)ARRAY_LENGTH(lines); ++i)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001527 {
1528 p = lines[i];
1529#ifdef FEAT_GUI
1530 if (p_im && gui.in_use && gui_lines[i] != NULL)
1531 p = gui_lines[i];
1532#endif
1533 if (p == NULL)
1534 {
1535 if (!p_cp)
1536 break;
1537 continue;
1538 }
1539 if (sponsor != 0)
1540 {
1541 if (strstr(p, "children") != NULL)
1542 p = sponsor < 0
1543 ? N_("Sponsor Vim development!")
1544 : N_("Become a registered Vim user!");
1545 else if (strstr(p, "iccf") != NULL)
1546 p = sponsor < 0
1547 ? N_("type :help sponsor<Enter> for information ")
1548 : N_("type :help register<Enter> for information ");
1549 else if (strstr(p, "Orphans") != NULL)
1550 p = N_("menu Help->Sponsor/Register for information ");
1551 }
1552 if (*p != NUL)
1553 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1554 ++row;
1555 }
Bram Moolenaar071d4272004-06-13 20:20:40 +00001556 }
1557
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001558 // Make the wait-return message appear just below the text.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001559 if (colon)
1560 msg_row = row;
1561}
1562
1563 static void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001564do_intro_line(
1565 int row,
1566 char_u *mesg,
1567 int add_version,
1568 int attr)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001569{
1570 char_u vers[20];
1571 int col;
1572 char_u *p;
1573 int l;
1574 int clen;
1575#ifdef MODIFIED_BY
1576# define MODBY_LEN 150
1577 char_u modby[MODBY_LEN];
1578
1579 if (*mesg == ' ')
1580 {
Bram Moolenaar589e43a2008-01-05 12:59:22 +00001581 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
Bram Moolenaar9b0ac222016-06-01 20:31:43 +02001582 l = (int)STRLEN(modby);
Bram Moolenaar589e43a2008-01-05 12:59:22 +00001583 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001584 mesg = modby;
1585 }
1586#endif
1587
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001588 // Center the message horizontally.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001589 col = vim_strsize(mesg);
1590 if (add_version)
1591 {
1592 STRCPY(vers, mediumVersion);
1593 if (highest_patch())
1594 {
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001595 // Check for 9.9x or 9.9xx, alpha/beta version
Bram Moolenaar22df3f92010-10-27 16:01:27 +02001596 if (isalpha((int)vers[3]))
Bram Moolenaar071d4272004-06-13 20:20:40 +00001597 {
Bram Moolenaar552ac132012-03-07 18:03:10 +01001598 int len = (isalpha((int)vers[4])) ? 5 : 4;
1599 sprintf((char *)vers + len, ".%d%s", highest_patch(),
1600 mediumVersion + len);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001601 }
1602 else
1603 sprintf((char *)vers + 3, ".%d", highest_patch());
1604 }
1605 col += (int)STRLEN(vers);
1606 }
1607 col = (Columns - col) / 2;
1608 if (col < 0)
1609 col = 0;
1610
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001611 // Split up in parts to highlight <> items differently.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001612 for (p = mesg; *p != NUL; p += l)
1613 {
1614 clen = 0;
1615 for (l = 0; p[l] != NUL
1616 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1617 {
Bram Moolenaar071d4272004-06-13 20:20:40 +00001618 if (has_mbyte)
1619 {
1620 clen += ptr2cells(p + l);
Bram Moolenaar0fa313a2005-08-10 21:07:57 +00001621 l += (*mb_ptr2len)(p + l) - 1;
Bram Moolenaar071d4272004-06-13 20:20:40 +00001622 }
1623 else
Bram Moolenaar071d4272004-06-13 20:20:40 +00001624 clen += byte2cells(p[l]);
1625 }
Bram Moolenaar8820b482017-03-16 17:23:31 +01001626 screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
Bram Moolenaar071d4272004-06-13 20:20:40 +00001627 col += clen;
1628 }
1629
Bram Moolenaaraa2f0ee2019-12-21 18:47:26 +01001630 // Add the version number to the version line.
Bram Moolenaar071d4272004-06-13 20:20:40 +00001631 if (add_version)
1632 screen_puts(vers, row, col, 0);
1633}
1634
1635/*
1636 * ":intro": clear screen, display intro screen and wait for return.
1637 */
Bram Moolenaar071d4272004-06-13 20:20:40 +00001638 void
Bram Moolenaarb638a7b2016-01-30 21:29:58 +01001639ex_intro(exarg_T *eap UNUSED)
Bram Moolenaar071d4272004-06-13 20:20:40 +00001640{
1641 screenclear();
1642 intro_message(TRUE);
1643 wait_return(TRUE);
1644}