2016-08-29 22:49:24 +02:00
|
|
|
/* vi:set ts=8 sts=4 sw=4 noet:
|
2004-06-13 20:20:40 +00:00
|
|
|
*
|
|
|
|
* VIM - Vi IMproved by Bram Moolenaar
|
|
|
|
*
|
|
|
|
* Do ":help uganda" in Vim to read copying and usage conditions.
|
|
|
|
* Do ":help credits" in Vim to see a list of people who contributed.
|
|
|
|
* See README.txt for an overview of the Vim source code.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "vim.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
|
|
|
|
* It has been changed beyond recognition since then.
|
|
|
|
*
|
2022-06-23 20:46:27 +01:00
|
|
|
* Differences between version 8.2 and 9.0 can be found with ":help version9".
|
2016-09-12 16:23:34 +02:00
|
|
|
* Differences between version 7.4 and 8.x can be found with ":help version8".
|
|
|
|
* Differences between version 6.4 and 7.x can be found with ":help version7".
|
|
|
|
* Differences between version 5.8 and 6.x can be found with ":help version6".
|
2004-06-13 20:20:40 +00:00
|
|
|
* Differences between version 4.x and 5.x can be found with ":help version5".
|
|
|
|
* Differences between version 3.0 and 4.x can be found with ":help version4".
|
|
|
|
* All the remarks about older versions have been removed, they are not very
|
|
|
|
* interesting.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "version.h"
|
|
|
|
|
2005-06-30 22:04:15 +00:00
|
|
|
char *Version = VIM_VERSION_SHORT;
|
|
|
|
static char *mediumVersion = VIM_VERSION_MEDIUM;
|
2004-06-13 20:20:40 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_DATE_TIME) || defined(PROTO)
|
|
|
|
# if (defined(VMS) && defined(VAXC)) || defined(PROTO)
|
|
|
|
char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
|
|
|
|
+ sizeof(__TIME__) + 3];
|
2013-02-20 16:47:36 +01:00
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
void
|
2018-06-23 16:12:21 +02:00
|
|
|
init_longVersion(void)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Construct the long version string. Necessary because
|
2019-03-02 10:13:42 +01:00
|
|
|
* VAX C can't concatenate strings in the preprocessor.
|
2004-06-13 20:20:40 +00:00
|
|
|
*/
|
|
|
|
strcpy(longVersion, VIM_VERSION_LONG_DATE);
|
2020-06-05 23:16:29 +02:00
|
|
|
#ifdef BUILD_DATE
|
|
|
|
strcat(longVersion, BUILD_DATE);
|
|
|
|
#else
|
2004-06-13 20:20:40 +00:00
|
|
|
strcat(longVersion, __DATE__);
|
|
|
|
strcat(longVersion, " ");
|
|
|
|
strcat(longVersion, __TIME__);
|
2020-06-05 23:16:29 +02:00
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
strcat(longVersion, ")");
|
|
|
|
}
|
2018-06-23 16:12:21 +02:00
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
# else
|
2021-09-17 20:45:30 +02:00
|
|
|
char *longVersion = NULL;
|
|
|
|
|
2018-06-23 16:12:21 +02:00
|
|
|
void
|
|
|
|
init_longVersion(void)
|
|
|
|
{
|
2023-01-26 12:00:00 +00:00
|
|
|
if (longVersion != NULL)
|
|
|
|
return;
|
|
|
|
|
2020-06-05 23:16:29 +02:00
|
|
|
#ifdef BUILD_DATE
|
2023-01-26 12:00:00 +00:00
|
|
|
char *date_time = BUILD_DATE;
|
2020-06-05 23:16:29 +02:00
|
|
|
#else
|
2023-01-26 12:00:00 +00:00
|
|
|
char *date_time = __DATE__ " " __TIME__;
|
2020-06-05 23:16:29 +02:00
|
|
|
#endif
|
2023-01-26 12:00:00 +00:00
|
|
|
char *msg = _("%s (%s, compiled %s)");
|
|
|
|
size_t len = strlen(msg)
|
|
|
|
+ strlen(VIM_VERSION_LONG_ONLY)
|
|
|
|
+ strlen(VIM_VERSION_DATE_ONLY)
|
|
|
|
+ strlen(date_time);
|
2020-04-13 18:25:33 +02:00
|
|
|
|
2023-01-26 12:00:00 +00:00
|
|
|
longVersion = alloc(len);
|
|
|
|
if (longVersion == NULL)
|
|
|
|
longVersion = VIM_VERSION_LONG;
|
|
|
|
else
|
|
|
|
vim_snprintf(longVersion, len, msg,
|
|
|
|
VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
|
2018-06-23 16:12:21 +02:00
|
|
|
}
|
2004-06-13 20:20:40 +00:00
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
char *longVersion = VIM_VERSION_LONG;
|
2018-06-24 14:44:46 +02:00
|
|
|
|
|
|
|
void
|
|
|
|
init_longVersion(void)
|
|
|
|
{
|
|
|
|
// nothing to do
|
|
|
|
}
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static char *(features[]) =
|
|
|
|
{
|
2013-08-30 16:35:44 +02:00
|
|
|
#ifdef HAVE_ACL
|
|
|
|
"+acl",
|
|
|
|
#else
|
|
|
|
"-acl",
|
|
|
|
#endif
|
2019-12-21 18:47:26 +01:00
|
|
|
#ifdef AMIGA // only for Amiga systems
|
2004-06-13 20:20:40 +00:00
|
|
|
# ifdef FEAT_ARP
|
|
|
|
"+ARP",
|
|
|
|
# else
|
|
|
|
"-ARP",
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_ARABIC
|
|
|
|
"+arabic",
|
|
|
|
#else
|
|
|
|
"-arabic",
|
|
|
|
#endif
|
|
|
|
"+autocmd",
|
2018-07-27 22:08:59 +02:00
|
|
|
#ifdef FEAT_AUTOCHDIR
|
|
|
|
"+autochdir",
|
|
|
|
#else
|
|
|
|
"-autochdir",
|
|
|
|
#endif
|
2017-11-12 19:21:51 +01:00
|
|
|
#ifdef FEAT_AUTOSERVERNAME
|
|
|
|
"+autoservername",
|
|
|
|
#else
|
|
|
|
"-autoservername",
|
|
|
|
#endif
|
2017-11-18 22:13:31 +01:00
|
|
|
#ifdef FEAT_BEVAL_GUI
|
2004-06-13 20:20:40 +00:00
|
|
|
"+balloon_eval",
|
|
|
|
#else
|
|
|
|
"-balloon_eval",
|
|
|
|
#endif
|
2017-11-18 22:13:31 +01:00
|
|
|
#ifdef FEAT_BEVAL_TERM
|
2017-11-18 18:52:04 +01:00
|
|
|
"+balloon_eval_term",
|
|
|
|
#else
|
|
|
|
"-balloon_eval_term",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_BROWSE
|
|
|
|
"+browse",
|
|
|
|
#else
|
|
|
|
"-browse",
|
|
|
|
#endif
|
|
|
|
"++builtin_terms",
|
|
|
|
#ifdef FEAT_BYTEOFF
|
|
|
|
"+byte_offset",
|
|
|
|
#else
|
|
|
|
"-byte_offset",
|
|
|
|
#endif
|
2016-03-11 22:52:15 +01:00
|
|
|
#ifdef FEAT_JOB_CHANNEL
|
2016-01-25 20:15:45 +01:00
|
|
|
"+channel",
|
|
|
|
#else
|
|
|
|
"-channel",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
"+cindent",
|
|
|
|
#ifdef FEAT_CLIENTSERVER
|
|
|
|
"+clientserver",
|
|
|
|
#else
|
|
|
|
"-clientserver",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_CLIPBOARD
|
|
|
|
"+clipboard",
|
|
|
|
#else
|
|
|
|
"-clipboard",
|
|
|
|
#endif
|
|
|
|
"+cmdline_compl",
|
|
|
|
"+cmdline_hist",
|
|
|
|
"+cmdline_info",
|
|
|
|
"+comments",
|
2010-06-05 23:22:07 +02:00
|
|
|
#ifdef FEAT_CONCEAL
|
|
|
|
"+conceal",
|
|
|
|
#else
|
|
|
|
"-conceal",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_CRYPT
|
|
|
|
"+cryptv",
|
|
|
|
#else
|
|
|
|
"-cryptv",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_CSCOPE
|
|
|
|
"+cscope",
|
|
|
|
#else
|
|
|
|
"-cscope",
|
|
|
|
#endif
|
2010-06-05 23:22:07 +02:00
|
|
|
"+cursorbind",
|
2006-01-26 22:25:15 +00:00
|
|
|
#ifdef CURSOR_SHAPE
|
|
|
|
"+cursorshape",
|
|
|
|
#else
|
|
|
|
"-cursorshape",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
|
|
|
|
"+dialog_con_gui",
|
|
|
|
#else
|
|
|
|
# if defined(FEAT_CON_DIALOG)
|
|
|
|
"+dialog_con",
|
|
|
|
# else
|
|
|
|
# if defined(FEAT_GUI_DIALOG)
|
|
|
|
"+dialog_gui",
|
|
|
|
# else
|
|
|
|
"-dialog",
|
|
|
|
# endif
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_DIFF
|
|
|
|
"+diff",
|
|
|
|
#else
|
|
|
|
"-diff",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_DIGRAPHS
|
|
|
|
"+digraphs",
|
|
|
|
#else
|
|
|
|
"-digraphs",
|
|
|
|
#endif
|
2019-02-17 17:44:42 +01:00
|
|
|
#ifdef FEAT_GUI_MSWIN
|
2014-08-06 14:52:30 +02:00
|
|
|
# ifdef FEAT_DIRECTX
|
|
|
|
"+directx",
|
|
|
|
# else
|
|
|
|
"-directx",
|
|
|
|
# endif
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_DND
|
|
|
|
"+dnd",
|
|
|
|
#else
|
|
|
|
"-dnd",
|
|
|
|
#endif
|
|
|
|
"-ebcdic",
|
|
|
|
#ifdef FEAT_EMACS_TAGS
|
|
|
|
"+emacs_tags",
|
|
|
|
#else
|
|
|
|
"-emacs_tags",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_EVAL
|
|
|
|
"+eval",
|
|
|
|
#else
|
|
|
|
"-eval",
|
|
|
|
#endif
|
|
|
|
"+ex_extra",
|
|
|
|
#ifdef FEAT_SEARCH_EXTRA
|
|
|
|
"+extra_search",
|
|
|
|
#else
|
|
|
|
"-extra_search",
|
|
|
|
#endif
|
|
|
|
"-farsi",
|
|
|
|
"+file_in_path",
|
|
|
|
#ifdef FEAT_FIND_ID
|
|
|
|
"+find_in_path",
|
|
|
|
#else
|
|
|
|
"-find_in_path",
|
|
|
|
#endif
|
2008-06-24 21:56:24 +00:00
|
|
|
"+float",
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_FOLDING
|
|
|
|
"+folding",
|
|
|
|
#else
|
|
|
|
"-folding",
|
|
|
|
#endif
|
|
|
|
"-footer",
|
2022-09-04 12:29:28 +01:00
|
|
|
// only interesting on Unix systems
|
2004-06-13 20:20:40 +00:00
|
|
|
#if !defined(USE_SYSTEM) && defined(UNIX)
|
|
|
|
"+fork()",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_GETTEXT
|
|
|
|
# ifdef DYNAMIC_GETTEXT
|
|
|
|
"+gettext/dyn",
|
|
|
|
# else
|
|
|
|
"+gettext",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-gettext",
|
|
|
|
#endif
|
|
|
|
"-hangul_input",
|
|
|
|
#if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
|
|
|
|
# ifdef DYNAMIC_ICONV
|
|
|
|
"+iconv/dyn",
|
|
|
|
# else
|
|
|
|
"+iconv",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-iconv",
|
|
|
|
#endif
|
|
|
|
"+insert_expand",
|
2020-04-13 19:04:21 +02:00
|
|
|
#ifdef FEAT_IPV6
|
|
|
|
"+ipv6",
|
|
|
|
#else
|
|
|
|
"-ipv6",
|
|
|
|
#endif
|
2016-03-11 22:52:15 +01:00
|
|
|
#ifdef FEAT_JOB_CHANNEL
|
2016-02-07 14:27:38 +01:00
|
|
|
"+job",
|
|
|
|
#else
|
|
|
|
"-job",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
"+jumplist",
|
|
|
|
#ifdef FEAT_KEYMAP
|
|
|
|
"+keymap",
|
|
|
|
#else
|
|
|
|
"-keymap",
|
|
|
|
#endif
|
2016-07-29 22:50:35 +02:00
|
|
|
#ifdef FEAT_EVAL
|
|
|
|
"+lambda",
|
|
|
|
#else
|
|
|
|
"-lambda",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_LANGMAP
|
|
|
|
"+langmap",
|
|
|
|
#else
|
|
|
|
"-langmap",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_LIBCALL
|
|
|
|
"+libcall",
|
|
|
|
#else
|
|
|
|
"-libcall",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_LINEBREAK
|
|
|
|
"+linebreak",
|
|
|
|
#else
|
|
|
|
"-linebreak",
|
|
|
|
#endif
|
|
|
|
"+lispindent",
|
|
|
|
"+listcmds",
|
|
|
|
"+localmap",
|
2010-07-14 23:23:17 +02:00
|
|
|
#ifdef FEAT_LUA
|
|
|
|
# ifdef DYNAMIC_LUA
|
|
|
|
"+lua/dyn",
|
|
|
|
# else
|
|
|
|
"+lua",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-lua",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_MENU
|
|
|
|
"+menu",
|
|
|
|
#else
|
|
|
|
"-menu",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_SESSION
|
|
|
|
"+mksession",
|
|
|
|
#else
|
|
|
|
"-mksession",
|
|
|
|
#endif
|
|
|
|
"+modify_fname",
|
|
|
|
"+mouse",
|
2019-10-17 23:00:07 +02:00
|
|
|
#ifdef FEAT_MOUSESHAPE
|
2004-06-13 20:20:40 +00:00
|
|
|
"+mouseshape",
|
2019-10-17 23:00:07 +02:00
|
|
|
#else
|
2004-06-13 20:20:40 +00:00
|
|
|
"-mouseshape",
|
|
|
|
#endif
|
2012-10-21 04:00:07 +02:00
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
#if defined(UNIX) || defined(VMS)
|
|
|
|
# ifdef FEAT_MOUSE_DEC
|
|
|
|
"+mouse_dec",
|
|
|
|
# else
|
|
|
|
"-mouse_dec",
|
|
|
|
# endif
|
|
|
|
# ifdef FEAT_MOUSE_GPM
|
2022-02-23 18:07:38 +00:00
|
|
|
# ifdef DYNAMIC_GPM
|
|
|
|
"+mouse_gpm/dyn",
|
|
|
|
# else
|
2004-06-13 20:20:40 +00:00
|
|
|
"+mouse_gpm",
|
2022-02-23 18:07:38 +00:00
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
# else
|
|
|
|
"-mouse_gpm",
|
|
|
|
# endif
|
|
|
|
# ifdef FEAT_MOUSE_JSB
|
|
|
|
"+mouse_jsbterm",
|
|
|
|
# else
|
|
|
|
"-mouse_jsbterm",
|
|
|
|
# endif
|
|
|
|
# ifdef FEAT_MOUSE_NET
|
|
|
|
"+mouse_netterm",
|
|
|
|
# else
|
|
|
|
"-mouse_netterm",
|
|
|
|
# endif
|
2012-10-21 04:00:07 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __QNX__
|
|
|
|
# ifdef FEAT_MOUSE_PTERM
|
|
|
|
"+mouse_pterm",
|
|
|
|
# else
|
|
|
|
"-mouse_pterm",
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(UNIX) || defined(VMS)
|
|
|
|
"+mouse_sgr",
|
2008-06-24 21:56:24 +00:00
|
|
|
# ifdef FEAT_SYSMOUSE
|
|
|
|
"+mouse_sysmouse",
|
|
|
|
# else
|
|
|
|
"-mouse_sysmouse",
|
|
|
|
# endif
|
2011-10-20 21:09:35 +02:00
|
|
|
# ifdef FEAT_MOUSE_URXVT
|
|
|
|
"+mouse_urxvt",
|
|
|
|
# else
|
|
|
|
"-mouse_urxvt",
|
|
|
|
# endif
|
2012-10-21 04:00:07 +02:00
|
|
|
"+mouse_xterm",
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
2012-10-21 04:00:07 +02:00
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_MBYTE_IME
|
|
|
|
# ifdef DYNAMIC_IME
|
|
|
|
"+multi_byte_ime/dyn",
|
|
|
|
# else
|
|
|
|
"+multi_byte_ime",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"+multi_byte",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_MULTI_LANG
|
|
|
|
"+multi_lang",
|
|
|
|
#else
|
|
|
|
"-multi_lang",
|
|
|
|
#endif
|
2004-07-05 15:58:32 +00:00
|
|
|
#ifdef FEAT_MZSCHEME
|
2005-01-25 22:07:05 +00:00
|
|
|
# ifdef DYNAMIC_MZSCHEME
|
|
|
|
"+mzscheme/dyn",
|
|
|
|
# else
|
2004-07-05 15:58:32 +00:00
|
|
|
"+mzscheme",
|
2005-01-25 22:07:05 +00:00
|
|
|
# endif
|
2004-07-05 15:58:32 +00:00
|
|
|
#else
|
|
|
|
"-mzscheme",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_NETBEANS_INTG
|
|
|
|
"+netbeans_intg",
|
|
|
|
#else
|
|
|
|
"-netbeans_intg",
|
|
|
|
#endif
|
2016-07-01 18:17:26 +02:00
|
|
|
"+num64",
|
2019-02-17 17:44:42 +01:00
|
|
|
#ifdef FEAT_GUI_MSWIN
|
2004-06-13 20:20:40 +00:00
|
|
|
# ifdef FEAT_OLE
|
|
|
|
"+ole",
|
|
|
|
# else
|
|
|
|
"-ole",
|
|
|
|
# endif
|
|
|
|
#endif
|
2018-07-22 05:08:11 +02:00
|
|
|
#ifdef FEAT_EVAL
|
2016-02-21 23:02:49 +01:00
|
|
|
"+packages",
|
2018-07-22 05:08:11 +02:00
|
|
|
#else
|
|
|
|
"-packages",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
"+path_extra",
|
|
|
|
#ifdef FEAT_PERL
|
|
|
|
# ifdef DYNAMIC_PERL
|
|
|
|
"+perl/dyn",
|
|
|
|
# else
|
|
|
|
"+perl",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-perl",
|
|
|
|
#endif
|
2010-05-23 23:34:36 +02:00
|
|
|
#ifdef FEAT_PERSISTENT_UNDO
|
|
|
|
"+persistent_undo",
|
|
|
|
#else
|
|
|
|
"-persistent_undo",
|
|
|
|
#endif
|
2019-11-30 22:48:27 +01:00
|
|
|
#ifdef FEAT_PROP_POPUP
|
|
|
|
"+popupwin",
|
|
|
|
#else
|
|
|
|
"-popupwin",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_PRINTER
|
|
|
|
# ifdef FEAT_POSTSCRIPT
|
|
|
|
"+postscript",
|
|
|
|
# else
|
|
|
|
"-postscript",
|
|
|
|
# endif
|
|
|
|
"+printer",
|
|
|
|
#else
|
|
|
|
"-printer",
|
|
|
|
#endif
|
2005-02-26 23:04:13 +00:00
|
|
|
#ifdef FEAT_PROFILE
|
|
|
|
"+profile",
|
|
|
|
#else
|
|
|
|
"-profile",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_PYTHON
|
|
|
|
# ifdef DYNAMIC_PYTHON
|
|
|
|
"+python/dyn",
|
|
|
|
# else
|
|
|
|
"+python",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-python",
|
|
|
|
#endif
|
2010-07-17 21:19:38 +02:00
|
|
|
#ifdef FEAT_PYTHON3
|
|
|
|
# ifdef DYNAMIC_PYTHON3
|
patch 9.0.1776: No support for stable Python 3 ABI
Problem: No support for stable Python 3 ABI
Solution: Support Python 3 stable ABI
Commits:
1) Support Python 3 stable ABI to allow mixed version interoperatbility
Vim currently supports embedding Python for use with plugins, and the
"dynamic" linking option allows the user to specify a locally installed
version of Python by setting `pythonthreedll`. However, one caveat is
that the Python 3 libs are not binary compatible across minor versions,
and mixing versions can potentially be dangerous (e.g. let's say Vim was
linked against the Python 3.10 SDK, but the user sets `pythonthreedll`
to a 3.11 lib). Usually, nothing bad happens, but in theory this could
lead to crashes, memory corruption, and other unpredictable behaviors.
It's also difficult for the user to tell something is wrong because Vim
has no way of reporting what Python 3 version Vim was linked with.
For Vim installed via a package manager, this usually isn't an issue
because all the dependencies would already be figured out. For prebuilt
Vim binaries like MacVim (my motivation for working on this), AppImage,
and Win32 installer this could potentially be an issue as usually a
single binary is distributed. This is more tricky when a new Python
version is released, as there's a chicken-and-egg issue with deciding
what Python version to build against and hard to keep in sync when a new
Python version just drops and we have a mix of users of different Python
versions, and a user just blindly upgrading to a new Python could lead to
bad interactions with Vim.
Python 3 does have a solution for this problem: stable ABI / limited API
(see https://docs.python.org/3/c-api/stable.html). The C SDK limits the
API to a set of functions that are promised to be stable across
versions. This pull request adds an ifdef config that allows us to turn
it on when building Vim. Vim binaries built with this option should be
safe to freely link with any Python 3 libraies without having the
constraint of having to use the same minor version.
Note: Python 2 has no such concept and this doesn't change how Python 2
integration works (not that there is going to be a new version of Python
2 that would cause compatibility issues in the future anyway).
---
Technical details:
======
The stable ABI can be accessed when we compile with the Python 3 limited
API (by defining `Py_LIMITED_API`). The Python 3 code (in `if_python3.c`
and `if_py_both.h`) would now handle this and switch to limited API
mode. Without it set, Vim will still use the full API as before so this
is an opt-in change.
The main difference is that `PyType_Object` is now an opaque struct that
we can't directly create "static types" out of, and we have to create
type objects as "heap types" instead. This is because the struct is not
stable and changes from version to version (e.g. 3.8 added a
`tp_vectorcall` field to it). I had to change all the types to be
allocated on the heap instead with just a pointer to them.
Other functions are also simply missing in limited API, or they are
introduced too late (e.g. `PyUnicode_AsUTF8AndSize` in 3.10) to it that
we need some other ways to do the same thing, so I had to abstract a few
things into macros, and sometimes re-implement functions like
`PyObject_NEW`.
One caveat is that in limited API, `OutputType` (used for replacing
`sys.stdout`) no longer inherits from `PyStdPrinter_Type` which I don't
think has any real issue other than minor differences in how they
convert to a string and missing a couple functions like `mode()` and
`fileno()`.
Also fixed an existing bug where `tp_basicsize` was set incorrectly for
`BufferObject`, `TabListObject, `WinListObject`.
Technically, there could be a small performance drop, there is a little
more indirection with accessing type objects, and some APIs like
`PyUnicode_AsUTF8AndSize` are missing, but in practice I didn't see any
difference, and any well-written Python plugin should try to avoid
excessing callbacks to the `vim` module in Python anyway.
I only tested limited API mode down to Python 3.7, which seemes to
compile and work fine. I haven't tried earlier Python versions.
2) Fix PyIter_Check on older Python vers / type##Ptr unused warning
For PyIter_Check, older versions exposed them as either macros (used in
full API), or a function (for use in limited API). A previous change
exposed PyIter_Check to the dynamic build because Python just moved it
to function-only in 3.10 anyway. Because of that, just make sure we
always grab the function in dynamic builds in earlier versions since
that's what Python eventually did anyway.
3) Move Py_LIMITED_API define to configure script
Can now use --with-python-stable-abi flag to customize what stable ABI
version to target. Can also use an env var to do so as well.
4) Show +python/dyn-stable in :version, and allow has() feature query
Not sure if the "/dyn-stable" suffix would break things, or whether we
should do it another way. Or just don't show it in version and rely on
has() feature checking.
5) Documentation first draft. Still need to implement v:python3_version
6) Fix PyIter_Check build breaks when compiling against Python 3.8
7) Add CI coverage stable ABI on Linux/Windows / make configurable on Windows
This adds configurable options for Windows make files (both MinGW and
MSVC). CI will also now exercise both traditional full API and stable
ABI for Linux and Windows in the matrix for coverage.
Also added a "dynamic" option to Linux matrix as a drive-by change to
make other scripting languages like Ruby / Perl testable under both
static and dynamic builds.
8) Fix inaccuracy in Windows docs
Python's own docs are confusing but you don't actually want to use
`python3.dll` for the dynamic linkage.
9) Add generated autoconf file
10) Add v:python3_version support
This variable indicates the version of Python3 that Vim was built
against (PY_VERSION_HEX), and will be useful to check whether the Python
library you are loading in dynamically actually fits it. When built with
stable ABI, it will be the limited ABI version instead
(`Py_LIMITED_API`), which indicates the minimum version of Python 3 the
user should have, rather than the exact match. When stable ABI is used,
we won't be exposing PY_VERSION_HEX in this var because it just doesn't
seem necessary to do so (the whole point of stable ABI is the promise
that it will work across versions), and I don't want to confuse the user
with too many variables.
Also, cleaned up some documentation, and added help tags.
11) Fix Python 3.7 compat issues
Fix a couple issues when using limited API < 3.8
- Crash on exit: In Python 3.7, if a heap-allocated type is destroyed
before all instances are, it would cause a crash later. This happens
when we destroyed `OptionsType` before calling `Py_Finalize` when
using the limited API. To make it worse, later versions changed the
semantics and now each instance has a strong reference to its own type
and the recommendation has changed to have each instance de-ref its
own type and have its type in GC traversal. To avoid dealing with
these cross-version variations, we just don't free the heap type. They
are static types in non-limited-API anyway and are designed to last
through the entirety of the app, and we also don't restart the Python
runtime and therefore do not need it to have absolutely 0 leaks.
See:
- https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-c-api
- https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api
- PyIter_Check: This function is not provided in limited APIs older than
3.8. Previously I was trying to mock it out using manual
PyType_GetSlot() but it was brittle and also does not actually work
properly for static types (it will generate a Python error). Just
return false. It does mean using limited API < 3.8 is not recommended
as you lose the functionality to handle iterators, but from playing
with plugins I couldn't find it to be an issue.
- Fix loading of PyIter_Check so it will be done when limited API < 3.8.
Otherwise loading a 3.7 Python lib will fail even if limited API was
specified to use it.
12) Make sure to only load `PyUnicode_AsUTF8AndSize` in needed in limited API
We don't use this function unless limited API >= 3.10, but we were
loading it regardless. Usually it's ok in Unix-like systems where Python
just has a single lib that we load from, but in Windows where there is a
separate python3.dll this would not work as the symbol would not have
been exposed in this more limited DLL file. This makes it much clearer
under what condition is this function needed.
closes: #12032
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-20 21:18:38 +02:00
|
|
|
# ifdef DYNAMIC_PYTHON3_STABLE_ABI
|
|
|
|
"+python3/dyn-stable",
|
|
|
|
# else
|
2010-07-17 21:19:38 +02:00
|
|
|
"+python3/dyn",
|
patch 9.0.1776: No support for stable Python 3 ABI
Problem: No support for stable Python 3 ABI
Solution: Support Python 3 stable ABI
Commits:
1) Support Python 3 stable ABI to allow mixed version interoperatbility
Vim currently supports embedding Python for use with plugins, and the
"dynamic" linking option allows the user to specify a locally installed
version of Python by setting `pythonthreedll`. However, one caveat is
that the Python 3 libs are not binary compatible across minor versions,
and mixing versions can potentially be dangerous (e.g. let's say Vim was
linked against the Python 3.10 SDK, but the user sets `pythonthreedll`
to a 3.11 lib). Usually, nothing bad happens, but in theory this could
lead to crashes, memory corruption, and other unpredictable behaviors.
It's also difficult for the user to tell something is wrong because Vim
has no way of reporting what Python 3 version Vim was linked with.
For Vim installed via a package manager, this usually isn't an issue
because all the dependencies would already be figured out. For prebuilt
Vim binaries like MacVim (my motivation for working on this), AppImage,
and Win32 installer this could potentially be an issue as usually a
single binary is distributed. This is more tricky when a new Python
version is released, as there's a chicken-and-egg issue with deciding
what Python version to build against and hard to keep in sync when a new
Python version just drops and we have a mix of users of different Python
versions, and a user just blindly upgrading to a new Python could lead to
bad interactions with Vim.
Python 3 does have a solution for this problem: stable ABI / limited API
(see https://docs.python.org/3/c-api/stable.html). The C SDK limits the
API to a set of functions that are promised to be stable across
versions. This pull request adds an ifdef config that allows us to turn
it on when building Vim. Vim binaries built with this option should be
safe to freely link with any Python 3 libraies without having the
constraint of having to use the same minor version.
Note: Python 2 has no such concept and this doesn't change how Python 2
integration works (not that there is going to be a new version of Python
2 that would cause compatibility issues in the future anyway).
---
Technical details:
======
The stable ABI can be accessed when we compile with the Python 3 limited
API (by defining `Py_LIMITED_API`). The Python 3 code (in `if_python3.c`
and `if_py_both.h`) would now handle this and switch to limited API
mode. Without it set, Vim will still use the full API as before so this
is an opt-in change.
The main difference is that `PyType_Object` is now an opaque struct that
we can't directly create "static types" out of, and we have to create
type objects as "heap types" instead. This is because the struct is not
stable and changes from version to version (e.g. 3.8 added a
`tp_vectorcall` field to it). I had to change all the types to be
allocated on the heap instead with just a pointer to them.
Other functions are also simply missing in limited API, or they are
introduced too late (e.g. `PyUnicode_AsUTF8AndSize` in 3.10) to it that
we need some other ways to do the same thing, so I had to abstract a few
things into macros, and sometimes re-implement functions like
`PyObject_NEW`.
One caveat is that in limited API, `OutputType` (used for replacing
`sys.stdout`) no longer inherits from `PyStdPrinter_Type` which I don't
think has any real issue other than minor differences in how they
convert to a string and missing a couple functions like `mode()` and
`fileno()`.
Also fixed an existing bug where `tp_basicsize` was set incorrectly for
`BufferObject`, `TabListObject, `WinListObject`.
Technically, there could be a small performance drop, there is a little
more indirection with accessing type objects, and some APIs like
`PyUnicode_AsUTF8AndSize` are missing, but in practice I didn't see any
difference, and any well-written Python plugin should try to avoid
excessing callbacks to the `vim` module in Python anyway.
I only tested limited API mode down to Python 3.7, which seemes to
compile and work fine. I haven't tried earlier Python versions.
2) Fix PyIter_Check on older Python vers / type##Ptr unused warning
For PyIter_Check, older versions exposed them as either macros (used in
full API), or a function (for use in limited API). A previous change
exposed PyIter_Check to the dynamic build because Python just moved it
to function-only in 3.10 anyway. Because of that, just make sure we
always grab the function in dynamic builds in earlier versions since
that's what Python eventually did anyway.
3) Move Py_LIMITED_API define to configure script
Can now use --with-python-stable-abi flag to customize what stable ABI
version to target. Can also use an env var to do so as well.
4) Show +python/dyn-stable in :version, and allow has() feature query
Not sure if the "/dyn-stable" suffix would break things, or whether we
should do it another way. Or just don't show it in version and rely on
has() feature checking.
5) Documentation first draft. Still need to implement v:python3_version
6) Fix PyIter_Check build breaks when compiling against Python 3.8
7) Add CI coverage stable ABI on Linux/Windows / make configurable on Windows
This adds configurable options for Windows make files (both MinGW and
MSVC). CI will also now exercise both traditional full API and stable
ABI for Linux and Windows in the matrix for coverage.
Also added a "dynamic" option to Linux matrix as a drive-by change to
make other scripting languages like Ruby / Perl testable under both
static and dynamic builds.
8) Fix inaccuracy in Windows docs
Python's own docs are confusing but you don't actually want to use
`python3.dll` for the dynamic linkage.
9) Add generated autoconf file
10) Add v:python3_version support
This variable indicates the version of Python3 that Vim was built
against (PY_VERSION_HEX), and will be useful to check whether the Python
library you are loading in dynamically actually fits it. When built with
stable ABI, it will be the limited ABI version instead
(`Py_LIMITED_API`), which indicates the minimum version of Python 3 the
user should have, rather than the exact match. When stable ABI is used,
we won't be exposing PY_VERSION_HEX in this var because it just doesn't
seem necessary to do so (the whole point of stable ABI is the promise
that it will work across versions), and I don't want to confuse the user
with too many variables.
Also, cleaned up some documentation, and added help tags.
11) Fix Python 3.7 compat issues
Fix a couple issues when using limited API < 3.8
- Crash on exit: In Python 3.7, if a heap-allocated type is destroyed
before all instances are, it would cause a crash later. This happens
when we destroyed `OptionsType` before calling `Py_Finalize` when
using the limited API. To make it worse, later versions changed the
semantics and now each instance has a strong reference to its own type
and the recommendation has changed to have each instance de-ref its
own type and have its type in GC traversal. To avoid dealing with
these cross-version variations, we just don't free the heap type. They
are static types in non-limited-API anyway and are designed to last
through the entirety of the app, and we also don't restart the Python
runtime and therefore do not need it to have absolutely 0 leaks.
See:
- https://docs.python.org/3/whatsnew/3.8.html#changes-in-the-c-api
- https://docs.python.org/3/whatsnew/3.9.html#changes-in-the-c-api
- PyIter_Check: This function is not provided in limited APIs older than
3.8. Previously I was trying to mock it out using manual
PyType_GetSlot() but it was brittle and also does not actually work
properly for static types (it will generate a Python error). Just
return false. It does mean using limited API < 3.8 is not recommended
as you lose the functionality to handle iterators, but from playing
with plugins I couldn't find it to be an issue.
- Fix loading of PyIter_Check so it will be done when limited API < 3.8.
Otherwise loading a 3.7 Python lib will fail even if limited API was
specified to use it.
12) Make sure to only load `PyUnicode_AsUTF8AndSize` in needed in limited API
We don't use this function unless limited API >= 3.10, but we were
loading it regardless. Usually it's ok in Unix-like systems where Python
just has a single lib that we load from, but in Windows where there is a
separate python3.dll this would not work as the symbol would not have
been exposed in this more limited DLL file. This makes it much clearer
under what condition is this function needed.
closes: #12032
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2023-08-20 21:18:38 +02:00
|
|
|
# endif
|
2010-07-17 21:19:38 +02:00
|
|
|
# else
|
|
|
|
"+python3",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-python3",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_QUICKFIX
|
|
|
|
"+quickfix",
|
|
|
|
#else
|
|
|
|
"-quickfix",
|
|
|
|
#endif
|
2006-05-02 22:08:30 +00:00
|
|
|
#ifdef FEAT_RELTIME
|
|
|
|
"+reltime",
|
|
|
|
#else
|
|
|
|
"-reltime",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_RIGHTLEFT
|
|
|
|
"+rightleft",
|
|
|
|
#else
|
|
|
|
"-rightleft",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_RUBY
|
|
|
|
# ifdef DYNAMIC_RUBY
|
|
|
|
"+ruby/dyn",
|
|
|
|
# else
|
|
|
|
"+ruby",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-ruby",
|
|
|
|
#endif
|
|
|
|
"+scrollbind",
|
|
|
|
#ifdef FEAT_SIGNS
|
|
|
|
"+signs",
|
|
|
|
#else
|
|
|
|
"-signs",
|
|
|
|
#endif
|
|
|
|
"+smartindent",
|
2021-06-20 14:02:16 +02:00
|
|
|
#ifdef FEAT_SODIUM
|
2022-02-12 11:18:37 +00:00
|
|
|
# ifdef DYNAMIC_SODIUM
|
|
|
|
"+sodium/dyn",
|
|
|
|
# else
|
2021-06-20 14:02:16 +02:00
|
|
|
"+sodium",
|
2022-02-12 11:18:37 +00:00
|
|
|
# endif
|
2021-06-20 14:02:16 +02:00
|
|
|
#else
|
|
|
|
"-sodium",
|
|
|
|
#endif
|
2019-06-09 13:43:51 +02:00
|
|
|
#ifdef FEAT_SOUND
|
|
|
|
"+sound",
|
|
|
|
#else
|
|
|
|
"-sound",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_SPELL
|
|
|
|
"+spell",
|
|
|
|
#else
|
|
|
|
"-spell",
|
|
|
|
#endif
|
2009-11-11 13:22:11 +00:00
|
|
|
#ifdef STARTUPTIME
|
|
|
|
"+startuptime",
|
|
|
|
#else
|
|
|
|
"-startuptime",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_STL_OPT
|
|
|
|
"+statusline",
|
|
|
|
#else
|
|
|
|
"-statusline",
|
|
|
|
#endif
|
|
|
|
"-sun_workshop",
|
|
|
|
#ifdef FEAT_SYN_HL
|
|
|
|
"+syntax",
|
|
|
|
#else
|
|
|
|
"-syntax",
|
|
|
|
#endif
|
2019-12-21 18:47:26 +01:00
|
|
|
// only interesting on Unix systems
|
2016-07-16 14:47:36 +02:00
|
|
|
#if defined(USE_SYSTEM) && defined(UNIX)
|
2004-06-13 20:20:40 +00:00
|
|
|
"+system()",
|
|
|
|
#endif
|
|
|
|
"+tag_binary",
|
|
|
|
"-tag_old_static",
|
|
|
|
"-tag_any_white",
|
|
|
|
#ifdef FEAT_TCL
|
|
|
|
# ifdef DYNAMIC_TCL
|
|
|
|
"+tcl/dyn",
|
|
|
|
# else
|
|
|
|
"+tcl",
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
"-tcl",
|
|
|
|
#endif
|
2016-04-29 22:59:22 +02:00
|
|
|
#ifdef FEAT_TERMGUICOLORS
|
|
|
|
"+termguicolors",
|
|
|
|
#else
|
|
|
|
"-termguicolors",
|
|
|
|
#endif
|
2017-07-15 20:05:54 +02:00
|
|
|
#ifdef FEAT_TERMINAL
|
|
|
|
"+terminal",
|
|
|
|
#else
|
|
|
|
"-terminal",
|
|
|
|
#endif
|
2016-07-16 14:47:36 +02:00
|
|
|
#if defined(UNIX)
|
2019-12-21 18:47:26 +01:00
|
|
|
// only Unix can have terminfo instead of termcap
|
2004-06-13 20:20:40 +00:00
|
|
|
# ifdef TERMINFO
|
|
|
|
"+terminfo",
|
|
|
|
# else
|
|
|
|
"-terminfo",
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_TERMRESPONSE
|
|
|
|
"+termresponse",
|
|
|
|
#else
|
|
|
|
"-termresponse",
|
|
|
|
#endif
|
|
|
|
"+textobjects",
|
2019-11-30 22:48:27 +01:00
|
|
|
#ifdef FEAT_PROP_POPUP
|
2018-12-13 22:20:09 +01:00
|
|
|
"+textprop",
|
|
|
|
#else
|
|
|
|
"-textprop",
|
|
|
|
#endif
|
|
|
|
#if !defined(UNIX)
|
2019-12-21 18:47:26 +01:00
|
|
|
// unix always includes termcap support
|
2018-12-13 22:20:09 +01:00
|
|
|
# ifdef HAVE_TGETENT
|
|
|
|
"+tgetent",
|
|
|
|
# else
|
|
|
|
"-tgetent",
|
|
|
|
# endif
|
|
|
|
#endif
|
2016-03-15 23:10:59 +01:00
|
|
|
#ifdef FEAT_TIMERS
|
|
|
|
"+timers",
|
|
|
|
#else
|
|
|
|
"-timers",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
"+title",
|
|
|
|
#ifdef FEAT_TOOLBAR
|
|
|
|
"+toolbar",
|
|
|
|
#else
|
|
|
|
"-toolbar",
|
|
|
|
#endif
|
|
|
|
"+user_commands",
|
2018-06-23 19:23:02 +02:00
|
|
|
#ifdef FEAT_VARTABS
|
|
|
|
"+vartabs",
|
|
|
|
#else
|
|
|
|
"-vartabs",
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
"+vertsplit",
|
2022-01-02 12:06:33 +00:00
|
|
|
"+vim9script",
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_VIMINFO
|
|
|
|
"+viminfo",
|
|
|
|
#else
|
|
|
|
"-viminfo",
|
|
|
|
#endif
|
2022-01-02 12:06:33 +00:00
|
|
|
"+virtualedit",
|
|
|
|
"+visual",
|
|
|
|
"+visualextra",
|
2004-06-13 20:20:40 +00:00
|
|
|
"+vreplace",
|
2019-02-17 17:44:42 +01:00
|
|
|
#ifdef MSWIN
|
2018-02-22 21:07:09 +01:00
|
|
|
# ifdef FEAT_VTP
|
|
|
|
"+vtp",
|
|
|
|
# else
|
|
|
|
"-vtp",
|
|
|
|
# endif
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
"+wildignore",
|
|
|
|
"+wildmenu",
|
|
|
|
"+windows",
|
|
|
|
#ifdef FEAT_WRITEBACKUP
|
|
|
|
"+writebackup",
|
|
|
|
#else
|
|
|
|
"-writebackup",
|
|
|
|
#endif
|
|
|
|
#if defined(UNIX) || defined(VMS)
|
|
|
|
# ifdef FEAT_X11
|
|
|
|
"+X11",
|
|
|
|
# else
|
|
|
|
"-X11",
|
|
|
|
# endif
|
|
|
|
#endif
|
2023-09-30 12:49:18 +02:00
|
|
|
# ifdef FEAT_XATTR
|
|
|
|
"+xattr",
|
|
|
|
# else
|
|
|
|
"-xattr",
|
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_XFONTSET
|
|
|
|
"+xfontset",
|
|
|
|
#else
|
|
|
|
"-xfontset",
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_XIM
|
|
|
|
"+xim",
|
|
|
|
#else
|
|
|
|
"-xim",
|
|
|
|
#endif
|
2022-04-05 14:18:44 +01:00
|
|
|
#if defined(MSWIN)
|
2016-08-13 16:39:56 +02:00
|
|
|
# ifdef FEAT_XPM_W32
|
|
|
|
"+xpm_w32",
|
|
|
|
# else
|
|
|
|
"-xpm_w32",
|
|
|
|
# endif
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(HAVE_XPM)
|
2016-08-13 16:39:56 +02:00
|
|
|
"+xpm",
|
2022-04-05 14:18:44 +01:00
|
|
|
#else
|
2016-08-13 16:39:56 +02:00
|
|
|
"-xpm",
|
|
|
|
#endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#if defined(UNIX) || defined(VMS)
|
2022-04-05 14:18:44 +01:00
|
|
|
# if defined(USE_XSMP_INTERACT)
|
2004-06-13 20:20:40 +00:00
|
|
|
"+xsmp_interact",
|
2022-04-05 14:18:44 +01:00
|
|
|
# elif defined(USE_XSMP)
|
2004-06-13 20:20:40 +00:00
|
|
|
"+xsmp",
|
2022-04-05 14:18:44 +01:00
|
|
|
# else
|
2004-06-13 20:20:40 +00:00
|
|
|
"-xsmp",
|
|
|
|
# endif
|
|
|
|
# ifdef FEAT_XCLIPBOARD
|
|
|
|
"+xterm_clipboard",
|
|
|
|
# else
|
|
|
|
"-xterm_clipboard",
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_XTERM_SAVE
|
|
|
|
"+xterm_save",
|
|
|
|
#else
|
|
|
|
"-xterm_save",
|
|
|
|
#endif
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
static int included_patches[] =
|
|
|
|
{ /* Add new patch number below this line */
|
2024-04-16 22:55:04 +02:00
|
|
|
/**/
|
|
|
|
342,
|
2024-04-16 22:44:31 +02:00
|
|
|
/**/
|
|
|
|
341,
|
2024-04-16 22:23:17 +02:00
|
|
|
/**/
|
|
|
|
340,
|
2024-04-16 22:18:15 +02:00
|
|
|
/**/
|
|
|
|
339,
|
2024-04-16 22:11:56 +02:00
|
|
|
/**/
|
|
|
|
338,
|
2024-04-16 20:58:45 +02:00
|
|
|
/**/
|
|
|
|
337,
|
2024-04-15 20:08:38 +02:00
|
|
|
/**/
|
|
|
|
336,
|
2024-04-15 19:19:52 +02:00
|
|
|
/**/
|
|
|
|
335,
|
2024-04-15 19:14:38 +02:00
|
|
|
/**/
|
|
|
|
334,
|
2024-04-15 19:11:15 +02:00
|
|
|
/**/
|
|
|
|
333,
|
2024-04-15 19:01:04 +02:00
|
|
|
/**/
|
|
|
|
332,
|
2024-04-15 18:54:38 +02:00
|
|
|
/**/
|
|
|
|
331,
|
2024-04-14 23:45:02 +02:00
|
|
|
/**/
|
|
|
|
330,
|
2024-04-14 23:21:02 +02:00
|
|
|
/**/
|
|
|
|
329,
|
2024-04-14 23:14:50 +02:00
|
|
|
/**/
|
|
|
|
328,
|
2024-04-14 22:53:22 +02:00
|
|
|
/**/
|
|
|
|
327,
|
2024-04-14 20:38:24 +02:00
|
|
|
/**/
|
|
|
|
326,
|
2024-04-14 20:34:22 +02:00
|
|
|
/**/
|
|
|
|
325,
|
2024-04-14 20:29:43 +02:00
|
|
|
/**/
|
|
|
|
324,
|
2024-04-14 20:22:19 +02:00
|
|
|
/**/
|
|
|
|
323,
|
2024-04-14 20:14:33 +02:00
|
|
|
/**/
|
|
|
|
322,
|
2024-04-14 20:02:24 +02:00
|
|
|
/**/
|
|
|
|
321,
|
2024-04-14 18:52:49 +02:00
|
|
|
/**/
|
|
|
|
320,
|
2024-04-14 18:49:56 +02:00
|
|
|
/**/
|
|
|
|
319,
|
2024-04-13 18:28:28 +02:00
|
|
|
/**/
|
|
|
|
318,
|
2024-04-13 18:25:38 +02:00
|
|
|
/**/
|
|
|
|
317,
|
2024-04-13 18:19:20 +02:00
|
|
|
/**/
|
|
|
|
316,
|
2024-04-13 18:13:42 +02:00
|
|
|
/**/
|
|
|
|
315,
|
2024-04-13 17:58:09 +02:00
|
|
|
/**/
|
|
|
|
314,
|
2024-04-13 17:52:26 +02:00
|
|
|
/**/
|
|
|
|
313,
|
2024-04-12 18:48:35 +02:00
|
|
|
/**/
|
|
|
|
312,
|
2024-04-12 18:46:05 +02:00
|
|
|
/**/
|
|
|
|
311,
|
2024-04-12 18:38:38 +02:00
|
|
|
/**/
|
|
|
|
310,
|
2024-04-11 22:54:44 +02:00
|
|
|
/**/
|
|
|
|
309,
|
2024-04-11 21:54:34 +02:00
|
|
|
/**/
|
|
|
|
308,
|
2024-04-11 20:53:33 +02:00
|
|
|
/**/
|
|
|
|
307,
|
2024-04-11 20:47:45 +02:00
|
|
|
/**/
|
|
|
|
306,
|
2024-04-11 20:43:00 +02:00
|
|
|
/**/
|
|
|
|
305,
|
2024-04-10 22:52:40 +02:00
|
|
|
/**/
|
|
|
|
304,
|
2024-04-10 22:34:42 +02:00
|
|
|
/**/
|
|
|
|
303,
|
2024-04-10 22:28:28 +02:00
|
|
|
/**/
|
|
|
|
302,
|
2024-04-10 17:37:47 +02:00
|
|
|
/**/
|
|
|
|
301,
|
2024-04-10 17:33:43 +02:00
|
|
|
/**/
|
|
|
|
300,
|
2024-04-10 17:18:19 +02:00
|
|
|
/**/
|
|
|
|
299,
|
2024-04-10 16:34:49 +02:00
|
|
|
/**/
|
|
|
|
298,
|
2024-04-10 16:18:15 +02:00
|
|
|
/**/
|
|
|
|
297,
|
patch 9.1.0296: regexp: engines do not handle case-folding well
Problem: Regex engines do not handle case-folding well
Solution: Correctly calculate byte length of characters to skip
When the regexp engine compares two utf-8 codepoints case insensitively
it may match an adjacent character, because it assumes it can step over
as many bytes as the pattern contains.
This however is not necessarily true because of case-folding, a
multi-byte UTF-8 character can be considered equal to some single-byte
value.
Let's consider the pattern 'ſ' and the string 's'. When comparing and
ignoring case, the single character 's' matches, and since it matches
Vim will try to step over the match (by the amount of bytes of the
pattern), assuming that since it matches, the length of both strings is
the same.
However in that case, it should only step over the single byte
value 's' so by 1 byte and try to start matching after it again. So for the
backtracking engine we need to ensure:
- we try to match the correct length for the pattern and the text
- in case of a match, we step over it correctly
The same thing can happen for the NFA engine, when skipping to the next
character to test for a match. We are skipping over the regstart
pointer, however we do not consider the case that because of
case-folding we may need to adjust the number of bytes to skip over. So
this needs to be adjusted in find_match_text() as well.
A related issue turned out, when prog->match_text is actually empty. In
that case we should try to find the next match and skip this condition.
fixes: #14294
closes: #14433
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-09 22:53:19 +02:00
|
|
|
/**/
|
|
|
|
296,
|
2024-04-09 22:49:19 +02:00
|
|
|
/**/
|
|
|
|
295,
|
2024-04-09 22:43:49 +02:00
|
|
|
/**/
|
|
|
|
294,
|
2024-04-09 22:39:53 +02:00
|
|
|
/**/
|
|
|
|
293,
|
2024-04-09 22:25:41 +02:00
|
|
|
/**/
|
|
|
|
292,
|
2024-04-09 22:20:55 +02:00
|
|
|
/**/
|
|
|
|
291,
|
2024-04-09 22:14:37 +02:00
|
|
|
/**/
|
|
|
|
290,
|
2024-04-09 22:09:30 +02:00
|
|
|
/**/
|
|
|
|
289,
|
2024-04-09 22:04:54 +02:00
|
|
|
/**/
|
|
|
|
288,
|
2024-04-09 21:47:10 +02:00
|
|
|
/**/
|
|
|
|
287,
|
2024-04-09 21:39:27 +02:00
|
|
|
/**/
|
|
|
|
286,
|
2024-04-09 21:30:19 +02:00
|
|
|
/**/
|
|
|
|
285,
|
2024-04-09 21:22:41 +02:00
|
|
|
/**/
|
|
|
|
284,
|
2024-04-09 08:06:52 +02:00
|
|
|
/**/
|
|
|
|
283,
|
2024-04-08 23:28:12 +02:00
|
|
|
/**/
|
|
|
|
282,
|
2024-04-08 22:54:16 +02:00
|
|
|
/**/
|
|
|
|
281,
|
2024-04-08 22:27:41 +02:00
|
|
|
/**/
|
|
|
|
280,
|
2024-04-08 22:23:22 +02:00
|
|
|
/**/
|
|
|
|
279,
|
2024-04-08 22:19:06 +02:00
|
|
|
/**/
|
|
|
|
278,
|
2024-04-08 22:11:50 +02:00
|
|
|
/**/
|
|
|
|
277,
|
2024-04-08 20:53:19 +02:00
|
|
|
/**/
|
|
|
|
276,
|
2024-04-08 20:26:29 +02:00
|
|
|
/**/
|
|
|
|
275,
|
2024-04-07 18:26:22 +02:00
|
|
|
/**/
|
|
|
|
274,
|
2024-04-07 18:22:41 +02:00
|
|
|
/**/
|
|
|
|
273,
|
2024-04-07 18:16:10 +02:00
|
|
|
/**/
|
|
|
|
272,
|
2024-04-05 20:15:48 +02:00
|
|
|
/**/
|
|
|
|
271,
|
2024-04-05 20:12:19 +02:00
|
|
|
/**/
|
|
|
|
270,
|
2024-04-05 20:07:39 +02:00
|
|
|
/**/
|
|
|
|
269,
|
2024-04-05 20:05:11 +02:00
|
|
|
/**/
|
|
|
|
268,
|
2024-04-05 20:02:55 +02:00
|
|
|
/**/
|
|
|
|
267,
|
2024-04-05 19:52:38 +02:00
|
|
|
/**/
|
|
|
|
266,
|
2024-04-04 22:23:29 +02:00
|
|
|
/**/
|
|
|
|
265,
|
2024-04-04 21:55:10 +02:00
|
|
|
/**/
|
|
|
|
264,
|
2024-04-04 21:42:07 +02:00
|
|
|
/**/
|
|
|
|
263,
|
2024-04-04 21:33:36 +02:00
|
|
|
/**/
|
|
|
|
262,
|
2024-04-04 19:35:59 +02:00
|
|
|
/**/
|
|
|
|
261,
|
2024-04-03 22:50:40 +02:00
|
|
|
/**/
|
|
|
|
260,
|
2024-04-03 22:38:07 +02:00
|
|
|
/**/
|
|
|
|
259,
|
2024-04-02 20:49:45 +02:00
|
|
|
/**/
|
|
|
|
258,
|
2024-04-02 20:41:04 +02:00
|
|
|
/**/
|
|
|
|
257,
|
2024-04-02 20:26:01 +02:00
|
|
|
/**/
|
|
|
|
256,
|
2024-04-02 19:05:39 +02:00
|
|
|
/**/
|
|
|
|
255,
|
2024-04-02 19:01:14 +02:00
|
|
|
/**/
|
|
|
|
254,
|
2024-04-02 18:54:54 +02:00
|
|
|
/**/
|
|
|
|
253,
|
2024-04-01 14:50:41 +02:00
|
|
|
/**/
|
|
|
|
252,
|
2024-04-01 14:46:20 +02:00
|
|
|
/**/
|
|
|
|
251,
|
2024-03-31 19:57:16 +02:00
|
|
|
/**/
|
|
|
|
250,
|
2024-03-31 19:54:12 +02:00
|
|
|
/**/
|
|
|
|
249,
|
2024-03-31 19:51:19 +02:00
|
|
|
/**/
|
|
|
|
248,
|
2024-03-31 19:48:35 +02:00
|
|
|
/**/
|
|
|
|
247,
|
2024-03-31 19:45:11 +02:00
|
|
|
/**/
|
|
|
|
246,
|
2024-03-31 19:42:39 +02:00
|
|
|
/**/
|
|
|
|
245,
|
2024-03-31 19:22:51 +02:00
|
|
|
/**/
|
|
|
|
244,
|
2024-03-31 19:20:14 +02:00
|
|
|
/**/
|
|
|
|
243,
|
2024-03-31 19:18:10 +02:00
|
|
|
/**/
|
|
|
|
242,
|
2024-03-31 19:15:49 +02:00
|
|
|
/**/
|
|
|
|
241,
|
2024-03-31 19:12:36 +02:00
|
|
|
/**/
|
|
|
|
240,
|
2024-03-31 19:10:18 +02:00
|
|
|
/**/
|
|
|
|
239,
|
2024-03-31 19:08:07 +02:00
|
|
|
/**/
|
|
|
|
238,
|
2024-03-31 19:05:44 +02:00
|
|
|
/**/
|
|
|
|
237,
|
2024-03-31 19:02:26 +02:00
|
|
|
/**/
|
|
|
|
236,
|
2024-03-31 18:58:34 +02:00
|
|
|
/**/
|
|
|
|
235,
|
2024-03-31 18:54:55 +02:00
|
|
|
/**/
|
|
|
|
234,
|
2024-03-31 18:45:35 +02:00
|
|
|
/**/
|
|
|
|
233,
|
2024-03-31 18:43:51 +02:00
|
|
|
/**/
|
|
|
|
232,
|
2024-03-31 18:41:27 +02:00
|
|
|
/**/
|
|
|
|
231,
|
2024-03-31 18:38:09 +02:00
|
|
|
/**/
|
|
|
|
230,
|
2024-03-31 17:52:56 +02:00
|
|
|
/**/
|
|
|
|
229,
|
2024-03-29 10:23:19 +01:00
|
|
|
/**/
|
|
|
|
228,
|
2024-03-29 10:11:42 +01:00
|
|
|
/**/
|
|
|
|
227,
|
2024-03-29 10:08:23 +01:00
|
|
|
/**/
|
|
|
|
226,
|
2024-03-28 17:10:44 +01:00
|
|
|
/**/
|
|
|
|
225,
|
2024-03-28 12:01:14 +01:00
|
|
|
/**/
|
|
|
|
224,
|
2024-03-28 11:49:46 +01:00
|
|
|
/**/
|
|
|
|
223,
|
2024-03-28 11:47:32 +01:00
|
|
|
/**/
|
|
|
|
222,
|
2024-03-28 11:40:41 +01:00
|
|
|
/**/
|
|
|
|
221,
|
2024-03-28 11:37:26 +01:00
|
|
|
/**/
|
|
|
|
220,
|
2024-03-28 10:36:42 +01:00
|
|
|
/**/
|
|
|
|
219,
|
2024-03-28 10:30:08 +01:00
|
|
|
/**/
|
|
|
|
218,
|
|
|
|
/**/
|
|
|
|
217,
|
2024-03-28 10:11:57 +01:00
|
|
|
/**/
|
|
|
|
216,
|
2024-03-28 10:07:29 +01:00
|
|
|
/**/
|
|
|
|
215,
|
2024-03-28 10:04:25 +01:00
|
|
|
/**/
|
|
|
|
214,
|
2024-03-28 09:48:34 +01:00
|
|
|
/**/
|
|
|
|
213,
|
2024-03-27 10:44:14 +01:00
|
|
|
/**/
|
|
|
|
212,
|
2024-03-26 18:46:45 +01:00
|
|
|
/**/
|
|
|
|
211,
|
2024-03-26 18:44:48 +01:00
|
|
|
/**/
|
|
|
|
210,
|
2024-03-26 18:42:52 +01:00
|
|
|
/**/
|
|
|
|
209,
|
2024-03-26 18:29:30 +01:00
|
|
|
/**/
|
|
|
|
208,
|
2024-03-26 18:20:16 +01:00
|
|
|
/**/
|
|
|
|
207,
|
2024-03-26 18:05:01 +01:00
|
|
|
/**/
|
|
|
|
206,
|
2024-03-25 16:41:06 +01:00
|
|
|
/**/
|
|
|
|
205,
|
2024-03-25 16:34:51 +01:00
|
|
|
/**/
|
|
|
|
204,
|
2024-03-25 16:22:23 +01:00
|
|
|
/**/
|
|
|
|
203,
|
2024-03-24 09:50:03 +01:00
|
|
|
/**/
|
|
|
|
202,
|
2024-03-24 09:46:56 +01:00
|
|
|
/**/
|
|
|
|
201,
|
2024-03-24 09:43:25 +01:00
|
|
|
/**/
|
|
|
|
200,
|
2024-03-23 08:23:48 +01:00
|
|
|
/**/
|
|
|
|
199,
|
2024-03-22 19:56:17 +01:00
|
|
|
/**/
|
|
|
|
198,
|
2024-03-22 19:37:29 +01:00
|
|
|
/**/
|
|
|
|
197,
|
2024-03-21 20:24:51 +01:00
|
|
|
/**/
|
|
|
|
196,
|
2024-03-21 20:19:00 +01:00
|
|
|
/**/
|
|
|
|
195,
|
2024-03-21 20:12:59 +01:00
|
|
|
/**/
|
|
|
|
194,
|
2024-03-21 07:11:58 +01:00
|
|
|
/**/
|
|
|
|
193,
|
2024-03-20 20:19:47 +01:00
|
|
|
/**/
|
|
|
|
192,
|
2024-03-20 20:15:51 +01:00
|
|
|
/**/
|
|
|
|
191,
|
2024-03-20 20:07:29 +01:00
|
|
|
/**/
|
|
|
|
190,
|
2024-03-20 19:49:20 +01:00
|
|
|
/**/
|
|
|
|
189,
|
2024-03-19 18:06:22 +01:00
|
|
|
/**/
|
|
|
|
188,
|
2024-03-18 19:21:48 +01:00
|
|
|
/**/
|
|
|
|
187,
|
2024-03-17 19:44:30 +01:00
|
|
|
/**/
|
|
|
|
186,
|
2024-03-17 10:01:47 +01:00
|
|
|
/**/
|
|
|
|
185,
|
2024-03-16 15:03:33 +01:00
|
|
|
/**/
|
|
|
|
184,
|
2024-03-16 09:40:22 +01:00
|
|
|
/**/
|
|
|
|
183,
|
2024-03-16 09:39:06 +01:00
|
|
|
/**/
|
|
|
|
182,
|
2024-03-14 18:30:41 +01:00
|
|
|
/**/
|
|
|
|
181,
|
2024-03-14 18:22:17 +01:00
|
|
|
/**/
|
|
|
|
180,
|
2024-03-14 18:16:56 +01:00
|
|
|
/**/
|
|
|
|
179,
|
2024-03-13 20:59:27 +01:00
|
|
|
/**/
|
|
|
|
178,
|
2024-03-13 20:42:26 +01:00
|
|
|
/**/
|
|
|
|
177,
|
2024-03-13 20:38:26 +01:00
|
|
|
/**/
|
|
|
|
176,
|
patch 9.1.0175: wrong window positions with 'winfix{width,height}'
Problem: winframe functions incorrectly recompute window positions if
the altframe wasn't adjacent to the closed frame, which is
possible if adjacent windows had 'winfix{width,height}' set.
Solution: recompute for windows within the parent of the altframe and
closed frame. Skip this (as before) if the altframe was
top/left, but only if adjacent to the closed frame, as
positions won't change in that case. Also correct the return
value documentation for win_screenpos. (Sean Dewar)
The issue revealed itself after removing the win_comp_pos call below
winframe_restore in win_splitmove. Similarly, wrong positions could result from
windows closed in other tabpages, as win_free_mem uses winframe_remove (at least
until it is entered later, where enter_tabpage calls win_comp_pos).
NOTE: As win_comp_pos handles only curtab, it's possible via other means for
positions in non-current tabpages to be wrong (e.g: after changing 'laststatus',
'showtabline', etc.). Given enter_tabpage recomputes it, maybe it's intentional
as an optimization? Should probably be documented in win_screenpos then, but I
won't address that here.
closes: #14191
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-13 20:17:24 +01:00
|
|
|
/**/
|
|
|
|
175,
|
2024-03-13 20:06:34 +01:00
|
|
|
/**/
|
|
|
|
174,
|
2024-03-12 22:11:36 +01:00
|
|
|
/**/
|
|
|
|
173,
|
2024-03-12 21:50:32 +01:00
|
|
|
/**/
|
|
|
|
172,
|
patch 9.1.0171: Small split-move related improvements
Problem: small improvements can be made to split-move related
functions.
Solution: apply them (Sean Dewar):
- Improve some doc comments (frame_flatten should still work for non-current
tabpages, despite the topframe check, which looks benign, though I'm unsure if
it's still needed; see #2467).
- f_win_splitmove should check_split_disallowed on wp, not targetwin, as that's
what win_splitmove checks (though it's probably unnecessary to check
b_locked_split at all; see #14109, which I hope to get around to finishing at
some point).
- Make winframe_restore restore window positions for the altframe, which
winframe_remove changes. This doesn't affect the prior behaviour, as we called
win_comp_pos after, but as win_comp_pos only works for curtab, and
winframe_remove supports non-current tabpages, we should undo it. Regardless,
this should mean we don't need win_comp_pos anymore; adjust tests to check
that window positions remain unchanged.
I'm not sure win_comp_pos is needed after last_status anyway if it doesn't
steal rows from another frame to make room for a new statusline, which
shouldn't be the case after winframe_remove? To be safe, I'll leave it as is.
closes: #14185
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12 21:11:39 +01:00
|
|
|
/**/
|
|
|
|
171,
|
patch 9.1.0170: Re-allow curwin == prevwin, but document it instead
Problem: more places exist where curwin == prevwin, and it may even be
expected in some cases.
Solution: revert v9.1.0001, but document that it's possible instead.
(Sean Dewar)
I've had a change of heart for the following reasons:
- A quick 'n dirty [GitHub code
search](https://github.com/search?q=%2F%28winnr%5C%28%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%7Cwinnr%5C%28%5B%27%22%5D%23%5B%27%22%5D%5C%29%5Cs*%3D%3D%5Cs*winnr%5C%28%5C%29%29%2F&type=code)
reveals some cases where it's expected in the wild.
Particularly, it made me aware `winnr() == winnr('#')` is possible when curwin
is changed temporarily during the evaluation of a &statusline expression item
(`%{...}`), and is used to show something different on the statusline
belonging to the previous window; that behaviour wasn't changed in v9.1.0001,
but it means curwin == prevwin makes sense in some cases.
- The definition and call sites of back_to_prevwin imply some expectation that
prevwin == wp (== curwin) is possible, as it's used to skip entering the
prevwin in that case.
- Prior to v9.1.0001, `:wincmd p` would not beep in the case that was patched in
v9.1.0001, but now does. That resulted in #14047 being opened, as it affected
the CtrlP plugin.
I find it odd that `:wincmd p` had cases where it wouldn't beep despite doing
nothing, but it may be preferable to keep things that way (or instead also
beep if curwin == prevwin, if that's preferred).
- After more digging, I found cases in win_free_mem, enter_tabpage,
aucmd_restbuf and qf_open_new_cwindow where curwin == prevwin is possible
(many of them from autocommands). Others probably exist too, especially in
places where curwin is changed temporarily.
fixes: #14047
closes: #14186
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12 20:46:12 +01:00
|
|
|
/**/
|
|
|
|
170,
|
2024-03-12 20:42:25 +01:00
|
|
|
/**/
|
|
|
|
169,
|
2024-03-11 22:04:45 +01:00
|
|
|
/**/
|
|
|
|
168,
|
2024-03-11 21:38:58 +01:00
|
|
|
/**/
|
|
|
|
167,
|
2024-03-11 21:36:42 +01:00
|
|
|
/**/
|
|
|
|
166,
|
2024-03-10 19:22:38 +01:00
|
|
|
/**/
|
|
|
|
165,
|
2024-03-10 15:46:58 +01:00
|
|
|
/**/
|
|
|
|
164,
|
2024-03-10 08:55:42 +01:00
|
|
|
/**/
|
|
|
|
163,
|
patch 9.1.0162: problem with writing extended attributes on failure
Problem: problem with writing extended attributes on failure
Solution: Change return type to ssize_t and check listxattr's return
value correctly on failure (Paul Tagliamonte)
The existing logic will return when the listxattr call returns with the
errno set to ENOTSUP (or a size of 0 bytes), without checking to see if
listxattr actually failed. listxattr can fail with at least E2BIG,
ENOTSUP, ERANGE, or anything that `stat(2)` can fail with (in my case;
ENOENT from stat).
The returned size is stored to a size_t, but the return type is a
ssize_t. On failure, listxattr returns -1, which will get translated to
size_t's MAX. If the listxattr call failed with anything other than
ENOTSUP, this triggers a request for size_t MAX bytes.
This means that, if the listxattr call fails with anything other than
ENOTSUP on save, vim will error with
`E342: Out of memory! (allocating 18446744073709551615 bytes)`
(keen observers will note 18446744073709551615 is 0xffffffffffffffff)
In reality, this is likely masking a different (usually filesystem?)
error -- but at least it's an error being pushed to the user now, and we
don't try to allocate size_t MAX bytes.
I've opted to change the type that we store listxattr to from size_t to
ssize_t, to match listxattr(2)'s signature, and to check for the -1
return value. Additionally, I've removed the errno check -- if we get a
listxattr failure for any reason, we may as well bail without trying;
it's not like we can even recover.
closes: #14169
Signed-off-by: Paul Tagliamonte <paultag@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-10 08:35:10 +01:00
|
|
|
/**/
|
|
|
|
162,
|
2024-03-09 17:44:46 +01:00
|
|
|
/**/
|
|
|
|
161,
|
2024-03-09 15:44:19 +01:00
|
|
|
/**/
|
|
|
|
160,
|
2024-03-09 15:39:27 +01:00
|
|
|
/**/
|
|
|
|
159,
|
2024-03-07 21:48:33 +01:00
|
|
|
/**/
|
|
|
|
158,
|
2024-03-07 21:40:53 +01:00
|
|
|
/**/
|
|
|
|
157,
|
2024-03-07 21:37:50 +01:00
|
|
|
/**/
|
|
|
|
156,
|
2024-03-06 21:10:18 +01:00
|
|
|
/**/
|
|
|
|
155,
|
2024-03-06 20:58:41 +01:00
|
|
|
/**/
|
|
|
|
154,
|
2024-03-06 20:54:22 +01:00
|
|
|
/**/
|
|
|
|
153,
|
2024-03-06 19:31:39 +01:00
|
|
|
/**/
|
|
|
|
152,
|
2024-03-05 20:43:25 +01:00
|
|
|
/**/
|
|
|
|
151,
|
patch 9.1.0150: Several minor 'winfixbuf' issues
Problem: several minor 'winfixbuf' issues exist, mostly relating to the
quickfix list
Solution: address them and adjust tests. Retab and reflow a few things too.
(Sean Dewar)
Things touched include:
- Replace the semsgs with gettext'd emsgs.
- Handle window switching in ex_listdo properly, so curbuf and curwin
are kept in-sync and trigger autocommands; handle those properly.
- Don't change the list entry index in qf_jump_edit_buffer if we fail
due to 'wfb' (achieved by returning FAIL; QF_ABORT should only be used
if the list was changed).
- Make qf_jump_edit_buffer actually switch to prevwin when using `:cXX`
commands **outside** of the list window if 'wfb' is set in curwin.
Handle autocommands properly in case they mess with the list.
NOTE: previously, it seemed to split if 'wfb' was set, but do nothing
and fail if prevwin is *valid*. This behaviour seemed strange, and maybe
unintentional? Now it aligns more with what's described for the `:cXX`
commands in the original PR description when used outside a list window,
I think.
- In both functions, only consider prevwin if 'wfb' isn't set for it;
fallback to splitting otherwise.
- Use win_split to split. Not sure if there was a specific reason for
using ex_splitview. win_split is simpler and respects modifiers like
:vertical that may have been used. Plus, its return value can be checked
for setting opened_window in qf code (technically win_split_ins autocmds
could immediately close it or change windows, in which the qf code might
close some other window on failure; it's already the case elsewhere,
though).
closes: #14142
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-05 20:39:07 +01:00
|
|
|
/**/
|
|
|
|
150,
|
2024-03-04 19:09:26 +01:00
|
|
|
/**/
|
|
|
|
149,
|
2024-03-03 16:26:58 +01:00
|
|
|
/**/
|
|
|
|
148,
|
2024-03-03 16:16:47 +01:00
|
|
|
/**/
|
|
|
|
147,
|
2024-03-01 23:01:43 +01:00
|
|
|
/**/
|
|
|
|
146,
|
2024-02-29 17:40:29 +01:00
|
|
|
/**/
|
|
|
|
145,
|
2024-02-29 17:30:43 +01:00
|
|
|
/**/
|
|
|
|
144,
|
patch 9.1.0143: [security]: autocmd causes use-after-free in set_curbuf()
Problem: [security]: autocmd cause use-after-free in set_curbuf()
(kawarimidoll)
Solution: check side-effect of BufLeave autocommand, when the number
of windows changed, close windows containing buffers that will
be wiped, if curbuf changed unexpectedly make sure b_nwindows
is decremented otherwise it cannot be wiped
set_curbuf() already makes some efforts to ensure the BufLeave
autocommands do not cause issues. However there are still 2 issues
that are not taken care of:
1) If a BufLeave autocommand opens a new window containing the same
buffer as that is going got be closed in close_buffer() a bit later,
we suddenly have another window open, containing a free'd buffer. So we
must check if the number of windows changed and if it does (and the
current buffer is going to be wiped (according to the 'bufhidden'
setting), let's immediately close all windows containing the current
buffer using close_windows()
2) If a BufLeave autocommand changes our current buffer (displays it in
the current window), buf->b_nwindow will be incremented. As part of
set_curbuf() we will however enter another buffer soon, which means, the
newly created curbuf will have b_nwindows still have set, even so the
buffer is no longer displayed in a window. This causes later problems,
because it will no longer be possible to wipe such a buffer. So just
before entering the final buffer, check if the curbuf changed when
calling the BufLeave autocommand and if it does (and curbuf is still
valid), decrement curbuf->b_nwindows.
Both issues can be verified using the provided test (however the second
issue only because such an impacted buffer won't be wiped, causing
futher issues in later tests).
fixes: #13839
closes: #14104
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28 23:32:00 +01:00
|
|
|
/**/
|
|
|
|
143,
|
patch 9.1.0142: getregion() can be improved
Problem: getregion() can be improved (after v9.1.120)
Solution: change getregion() implementation to use pos as lists and
one optional {opt} dictionary (Shougo Matsushita)
Note: The following is a breaking change!
Currently, the getregion() function (included as of patch v9.1.120) takes
3 arguments: the first 2 arguments are strings, describing a position,
arg3 is the type string.
However, that is slightly inflexible, there is no way to specify
additional arguments. So let's instead change the function signature to:
getregion(pos1, pos2 [, {Dict}]) where both pos1 and pos2 are lists.
This is slightly cleaner, and gives us the flexibility to specify
additional arguments as key/value pairs to the optional Dict arg.
Now it supports the "type" key to specify the selection type
(characterwise, blockwise or linewise) and now in addition one can also
define the selection type, independently of what the 'selection' option
actually is.
Technically, this is a breaking change, but since the getregion()
Vimscript function is still quite new, this should be fine.
closes: #14090
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-28 22:48:12 +01:00
|
|
|
/**/
|
|
|
|
142,
|
2024-02-28 21:49:51 +01:00
|
|
|
/**/
|
|
|
|
141,
|
2024-02-27 20:25:10 +01:00
|
|
|
/**/
|
|
|
|
140,
|
2024-02-26 22:23:05 +01:00
|
|
|
/**/
|
|
|
|
139,
|
2024-02-26 21:21:17 +01:00
|
|
|
/**/
|
|
|
|
138,
|
2024-02-26 20:38:36 +01:00
|
|
|
/**/
|
|
|
|
137,
|
2024-02-25 08:40:10 +01:00
|
|
|
/**/
|
|
|
|
136,
|
2024-02-24 16:51:32 +01:00
|
|
|
/**/
|
|
|
|
135,
|
2024-02-24 15:56:34 +01:00
|
|
|
/**/
|
|
|
|
134,
|
2024-02-24 14:26:52 +01:00
|
|
|
/**/
|
|
|
|
133,
|
2024-02-24 14:21:39 +01:00
|
|
|
/**/
|
|
|
|
132,
|
patch 9.1.0131: buffer-completion may not always find all matches
Problem: buffer-completion code too complicated and does not always
find all matches (irisjae)
Solution: do not try to anchor pattern to beginning of line or
directory-separator, always return all matches
Note: we are considering the non-fuzzy buffer-matching here.
Currently, the buffer-completion code makes 2 attempts to match a
pattern against the list of available patterns. First try is to match
the pattern and anchor it to either the beginning of the file name or
at a directory-separator (// or \\).
When a match is found, Vim returns the matching buffers and does not try
to find a match anywhere within a buffer name. So if you have opened two
buffers like /tmp/Foobar.c and /tmp/MyFoobar.c using `:b Foo` will only
complete to the first filename, but not the second (the same happens
with `getcompletion('Foo', 'buffer')`).
It may make sense, that completion priorities buffer names at directory
boundaries, but it inconsistent, may cause confusion why a certain
buffer name is not completed when typing `:b Foo<C-D>` which returns
only a single file name and then pressing Enter (to switch to that
buffer), Vim will error with 'E93: More than one match for Foo').
Similar things may happen when wiping the /tmp/Foobar.c pattern and
afterwards the completion starts completing other buffers.
So let's simplify the code and always match the pattern anywhere in the
buffer name, do not try to favor matches at directory boundaries. This
is also simplifies the code a bit, we do not need to run over the list
of buffers several times, but only twice.
fixes #13894
closes: #14082
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24 14:12:13 +01:00
|
|
|
/**/
|
|
|
|
131,
|
2024-02-24 10:20:24 +01:00
|
|
|
/**/
|
|
|
|
130,
|
2024-02-24 10:17:11 +01:00
|
|
|
/**/
|
|
|
|
129,
|
2024-02-22 19:53:33 +01:00
|
|
|
/**/
|
|
|
|
128,
|
2024-02-22 19:51:34 +01:00
|
|
|
/**/
|
|
|
|
127,
|
2024-02-22 19:48:06 +01:00
|
|
|
/**/
|
|
|
|
126,
|
2024-02-21 21:03:10 +01:00
|
|
|
/**/
|
|
|
|
125,
|
2024-02-21 21:00:59 +01:00
|
|
|
/**/
|
|
|
|
124,
|
2024-02-21 20:16:38 +01:00
|
|
|
/**/
|
|
|
|
123,
|
2024-02-21 19:48:37 +01:00
|
|
|
/**/
|
|
|
|
122,
|
2024-02-21 19:40:44 +01:00
|
|
|
/**/
|
|
|
|
121,
|
2024-02-21 00:02:45 +01:00
|
|
|
/**/
|
|
|
|
120,
|
2024-02-20 22:05:10 +01:00
|
|
|
/**/
|
|
|
|
119,
|
2024-02-20 22:00:33 +01:00
|
|
|
/**/
|
|
|
|
118,
|
patch 9.1.0117: Stop split-moving from firing WinNew and WinNewPre autocommands
Problem: win_splitmove fires WinNewPre and possibly WinNew when moving
windows, even though no new windows are created.
Solution: don't fire WinNew and WinNewPre when inserting an existing
window, even if it isn't the current window. Improve the
accuracy of related documentation. (Sean Dewar)
Likewise, before this patch, WinClosed was not fired anyway (even for :wincmd
H/J/K/L, which also didn't fire WinNew, but did still fire WinNewPre), despite
documentation saying windows are "closed". Note that :wincmd T actually indeed
works by creating a new window (and closing the old one), unlike the others.
This also fixes issues where WinNewPre is fired when split-moving while curwin
doesn't yet have a frame or entry in the window list, causing many things to not
work (it's not considered valid at that point). This was guaranteed when using
:wincmd H/J/K/L.
Because WinNewPre is no longer fired when split-moving, this makes restoring the
previous window layout on failure easier, as we can be sure that frames are not
resized from WinNewPre autocommands if win_split_ins fails. This allows us to
use a different strategy in the following commit.
--
In my opinion, this leaves questions about the current usefulness of WinNewPre.
A motivation described in #10635 states how creating a new window can steal room
from other windows, and how WinNewPre will be useful for detecting that, but
this is also true when inserting an existing window, which now doesn't fire it.
Maybe the autocommand should be changed to have a better name?
There are also other issues I found with the current implementation of WinNewPre
that need addressing:
- it allows switching windows and tabpages, which can cause incorrect windows to
be split/moved, and big problems when switching tabpages.
- it fires before win_split_ins checks for room, before it makes any changes to
window sizes or before it considers allocating a new window. This should be
changed or documented.
I hope to address some of this stuff in a different PR, if possible.
related: #14038
Signed-off-by: Sean Dewar <6256228+seandewar@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-20 21:52:31 +01:00
|
|
|
/**/
|
|
|
|
117,
|
2024-02-20 20:28:15 +01:00
|
|
|
/**/
|
|
|
|
116,
|
2024-02-18 18:53:08 +01:00
|
|
|
/**/
|
|
|
|
115,
|
2024-02-18 09:33:54 +01:00
|
|
|
/**/
|
|
|
|
114,
|
2024-02-15 20:17:37 +01:00
|
|
|
/**/
|
|
|
|
113,
|
2024-02-15 20:15:04 +01:00
|
|
|
/**/
|
|
|
|
112,
|
2024-02-15 00:16:02 +01:00
|
|
|
/**/
|
|
|
|
111,
|
2024-02-14 22:30:06 +01:00
|
|
|
/**/
|
|
|
|
110,
|
2024-02-14 21:31:47 +01:00
|
|
|
/**/
|
|
|
|
109,
|
2024-02-14 20:44:28 +01:00
|
|
|
/**/
|
|
|
|
108,
|
2024-02-14 20:34:58 +01:00
|
|
|
/**/
|
|
|
|
107,
|
2024-02-14 20:28:17 +01:00
|
|
|
/**/
|
|
|
|
106,
|
2024-02-13 20:32:04 +01:00
|
|
|
/**/
|
|
|
|
105,
|
2024-02-12 23:12:26 +01:00
|
|
|
/**/
|
|
|
|
104,
|
2024-02-12 22:53:20 +01:00
|
|
|
/**/
|
|
|
|
103,
|
2024-02-12 22:50:26 +01:00
|
|
|
/**/
|
|
|
|
102,
|
2024-02-12 22:14:53 +01:00
|
|
|
/**/
|
|
|
|
101,
|
2024-02-12 20:28:01 +01:00
|
|
|
/**/
|
|
|
|
100,
|
2024-02-12 20:21:26 +01:00
|
|
|
/**/
|
|
|
|
99,
|
2024-02-11 17:52:40 +01:00
|
|
|
/**/
|
|
|
|
98,
|
2024-02-11 17:16:19 +01:00
|
|
|
/**/
|
|
|
|
97,
|
2024-02-11 17:08:29 +01:00
|
|
|
/**/
|
|
|
|
96,
|
2024-02-10 13:50:54 +01:00
|
|
|
/**/
|
|
|
|
95,
|
2024-02-10 13:31:06 +01:00
|
|
|
/**/
|
|
|
|
94,
|
2024-02-10 13:24:03 +01:00
|
|
|
/**/
|
|
|
|
93,
|
2024-02-10 13:17:16 +01:00
|
|
|
/**/
|
|
|
|
92,
|
2024-02-10 13:02:17 +01:00
|
|
|
/**/
|
|
|
|
91,
|
2024-02-09 23:11:54 +01:00
|
|
|
/**/
|
|
|
|
90,
|
2024-02-09 19:39:14 +01:00
|
|
|
/**/
|
|
|
|
89,
|
2024-02-09 19:34:36 +01:00
|
|
|
/**/
|
|
|
|
88,
|
2024-02-09 19:30:26 +01:00
|
|
|
/**/
|
|
|
|
87,
|
2024-02-09 19:24:23 +01:00
|
|
|
/**/
|
|
|
|
86,
|
2024-02-09 19:13:12 +01:00
|
|
|
/**/
|
|
|
|
85,
|
2024-02-09 18:14:12 +01:00
|
|
|
/**/
|
|
|
|
84,
|
2024-02-08 11:37:40 +01:00
|
|
|
/**/
|
|
|
|
83,
|
2024-02-08 11:34:55 +01:00
|
|
|
/**/
|
|
|
|
82,
|
2024-02-08 11:04:21 +01:00
|
|
|
/**/
|
|
|
|
81,
|
2024-02-06 11:03:36 +01:00
|
|
|
/**/
|
|
|
|
80,
|
2024-02-06 10:59:03 +01:00
|
|
|
/**/
|
|
|
|
79,
|
2024-02-06 10:49:14 +01:00
|
|
|
/**/
|
|
|
|
78,
|
2024-02-06 10:43:36 +01:00
|
|
|
/**/
|
|
|
|
77,
|
2024-02-04 10:27:33 +01:00
|
|
|
/**/
|
|
|
|
76,
|
2024-02-03 18:11:13 +01:00
|
|
|
/**/
|
|
|
|
75,
|
2024-02-03 18:08:09 +01:00
|
|
|
/**/
|
|
|
|
74,
|
2024-02-03 18:04:05 +01:00
|
|
|
/**/
|
|
|
|
73,
|
2024-02-03 17:41:54 +01:00
|
|
|
/**/
|
|
|
|
72,
|
2024-02-01 22:05:27 +01:00
|
|
|
/**/
|
|
|
|
71,
|
2024-02-01 21:22:14 +01:00
|
|
|
/**/
|
|
|
|
70,
|
2024-02-01 21:11:16 +01:00
|
|
|
/**/
|
|
|
|
69,
|
2024-02-01 21:07:51 +01:00
|
|
|
/**/
|
|
|
|
68,
|
2024-01-31 22:10:50 +01:00
|
|
|
/**/
|
|
|
|
67,
|
2024-01-31 20:29:07 +01:00
|
|
|
/**/
|
|
|
|
66,
|
2024-01-29 21:46:58 +01:00
|
|
|
/**/
|
|
|
|
65,
|
2024-01-29 20:54:28 +01:00
|
|
|
/**/
|
|
|
|
64,
|
2024-01-29 20:14:01 +01:00
|
|
|
/**/
|
|
|
|
63,
|
2024-01-29 19:32:39 +01:00
|
|
|
/**/
|
|
|
|
62,
|
2024-01-28 23:33:29 +01:00
|
|
|
/**/
|
|
|
|
61,
|
2024-01-28 19:03:00 +01:00
|
|
|
/**/
|
|
|
|
60,
|
2024-01-25 23:07:00 +01:00
|
|
|
/**/
|
|
|
|
59,
|
2024-01-25 22:44:00 +01:00
|
|
|
/**/
|
|
|
|
58,
|
2024-01-25 22:28:37 +01:00
|
|
|
/**/
|
|
|
|
57,
|
2024-01-25 21:50:41 +01:00
|
|
|
/**/
|
|
|
|
56,
|
2024-01-25 21:40:05 +01:00
|
|
|
/**/
|
|
|
|
55,
|
2024-01-25 21:27:13 +01:00
|
|
|
/**/
|
|
|
|
54,
|
2024-01-25 21:23:22 +01:00
|
|
|
/**/
|
|
|
|
53,
|
2024-01-25 20:50:49 +01:00
|
|
|
/**/
|
|
|
|
52,
|
2024-01-25 20:44:49 +01:00
|
|
|
/**/
|
|
|
|
51,
|
2024-01-23 23:19:02 +01:00
|
|
|
/**/
|
|
|
|
50,
|
2023-08-16 17:15:05 +01:00
|
|
|
/**/
|
|
|
|
49,
|
2023-08-16 16:17:31 +01:00
|
|
|
/**/
|
|
|
|
48,
|
2023-08-16 14:17:36 +01:00
|
|
|
/**/
|
|
|
|
47,
|
2024-01-23 21:27:19 +01:00
|
|
|
/**/
|
|
|
|
46,
|
2024-01-23 21:13:58 +01:00
|
|
|
/**/
|
|
|
|
45,
|
2024-01-22 20:28:12 +01:00
|
|
|
/**/
|
|
|
|
44,
|
2024-01-22 20:12:34 +01:00
|
|
|
/**/
|
|
|
|
43,
|
2024-01-21 09:40:22 +01:00
|
|
|
/**/
|
|
|
|
42,
|
2024-01-17 18:37:32 +01:00
|
|
|
/**/
|
|
|
|
41,
|
2024-01-17 21:22:59 +01:00
|
|
|
/**/
|
|
|
|
40,
|
2024-01-17 20:54:49 +01:00
|
|
|
/**/
|
|
|
|
39,
|
2024-01-17 20:52:13 +01:00
|
|
|
/**/
|
|
|
|
38,
|
2024-01-17 20:42:53 +01:00
|
|
|
/**/
|
|
|
|
37,
|
2024-01-17 20:16:05 +01:00
|
|
|
/**/
|
|
|
|
36,
|
2024-01-16 17:25:17 +01:00
|
|
|
/**/
|
|
|
|
35,
|
2024-01-16 17:22:38 +01:00
|
|
|
/**/
|
|
|
|
34,
|
2024-01-16 17:19:59 +01:00
|
|
|
/**/
|
|
|
|
33,
|
2024-01-16 17:14:29 +01:00
|
|
|
/**/
|
|
|
|
32,
|
2024-01-15 22:51:22 +01:00
|
|
|
/**/
|
|
|
|
31,
|
2023-11-15 15:35:49 +01:00
|
|
|
/**/
|
|
|
|
30,
|
2024-01-14 20:19:59 +01:00
|
|
|
/**/
|
|
|
|
29,
|
2024-01-14 20:08:40 +01:00
|
|
|
/**/
|
|
|
|
28,
|
2024-01-13 11:47:33 +01:00
|
|
|
/**/
|
|
|
|
27,
|
2024-01-12 18:09:43 +01:00
|
|
|
/**/
|
|
|
|
26,
|
2024-01-12 18:02:10 +01:00
|
|
|
/**/
|
|
|
|
25,
|
2024-01-12 17:59:18 +01:00
|
|
|
/**/
|
|
|
|
24,
|
2024-01-09 21:05:48 +00:00
|
|
|
/**/
|
|
|
|
23,
|
2024-01-12 17:48:08 +01:00
|
|
|
/**/
|
|
|
|
22,
|
2024-01-12 17:43:05 +01:00
|
|
|
/**/
|
|
|
|
21,
|
2024-01-12 17:36:40 +01:00
|
|
|
/**/
|
|
|
|
20,
|
2024-01-12 17:34:40 +01:00
|
|
|
/**/
|
|
|
|
19,
|
2024-01-12 17:31:07 +01:00
|
|
|
/**/
|
|
|
|
18,
|
2024-01-12 17:21:55 +01:00
|
|
|
/**/
|
|
|
|
17,
|
2024-01-07 15:08:31 +01:00
|
|
|
/**/
|
|
|
|
16,
|
2024-01-05 18:19:52 +01:00
|
|
|
/**/
|
|
|
|
15,
|
2024-01-05 18:11:43 +01:00
|
|
|
/**/
|
|
|
|
14,
|
2024-01-05 17:59:04 +01:00
|
|
|
/**/
|
|
|
|
13,
|
2024-01-05 17:52:49 +01:00
|
|
|
/**/
|
|
|
|
12,
|
2024-01-04 22:54:08 +01:00
|
|
|
/**/
|
|
|
|
11,
|
2024-01-04 22:37:44 +01:00
|
|
|
/**/
|
|
|
|
10,
|
2024-01-04 22:28:46 +01:00
|
|
|
/**/
|
|
|
|
9,
|
2024-01-04 22:14:28 +01:00
|
|
|
/**/
|
|
|
|
8,
|
2024-01-04 21:43:36 +01:00
|
|
|
/**/
|
|
|
|
7,
|
2024-01-04 21:19:04 +01:00
|
|
|
/**/
|
|
|
|
6,
|
2024-01-04 21:01:13 +01:00
|
|
|
/**/
|
|
|
|
5,
|
2024-01-03 19:48:51 +01:00
|
|
|
/**/
|
|
|
|
4,
|
2024-01-03 19:31:05 +01:00
|
|
|
/**/
|
|
|
|
3,
|
2024-01-03 19:18:43 +01:00
|
|
|
/**/
|
|
|
|
2,
|
2024-01-03 18:52:52 +01:00
|
|
|
/**/
|
|
|
|
1,
|
2004-06-13 20:20:40 +00:00
|
|
|
/**/
|
|
|
|
0
|
|
|
|
};
|
|
|
|
|
2008-11-30 11:15:09 +00:00
|
|
|
/*
|
|
|
|
* Place to put a short description when adding a feature with a patch.
|
|
|
|
* Keep it short, e.g.,: "relative numbers", "persistent undo".
|
|
|
|
* Also add a comment marker to separate the lines.
|
|
|
|
* See the official Vim patches for the diff format: It must use a context of
|
2008-12-24 13:25:14 +00:00
|
|
|
* one line only. Create it by hand or use "diff -C2" and edit the patch.
|
2008-11-30 11:15:09 +00:00
|
|
|
*/
|
|
|
|
static char *(extra_patches[]) =
|
|
|
|
{ /* Add your patch description below this line */
|
|
|
|
/**/
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
int
|
2016-01-30 21:29:58 +01:00
|
|
|
highest_patch(void)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
2019-06-14 14:39:51 +02:00
|
|
|
// this relies on the highest patch number to be the first entry
|
|
|
|
return included_patches[0];
|
2004-06-13 20:20:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(FEAT_EVAL) || defined(PROTO)
|
|
|
|
/*
|
|
|
|
* Return TRUE if patch "n" has been included.
|
|
|
|
*/
|
|
|
|
int
|
2016-01-30 21:29:58 +01:00
|
|
|
has_patch(int n)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
2020-11-10 20:54:29 +01:00
|
|
|
int h, m, l;
|
2004-06-13 20:20:40 +00:00
|
|
|
|
2020-11-10 20:54:29 +01:00
|
|
|
// Perform a binary search.
|
|
|
|
l = 0;
|
2021-06-02 13:28:16 +02:00
|
|
|
h = (int)ARRAY_LENGTH(included_patches) - 1;
|
2022-06-30 11:03:39 +01:00
|
|
|
for (;;)
|
2020-11-10 20:54:29 +01:00
|
|
|
{
|
|
|
|
m = (l + h) / 2;
|
|
|
|
if (included_patches[m] == n)
|
2004-06-13 20:20:40 +00:00
|
|
|
return TRUE;
|
2022-06-30 11:03:39 +01:00
|
|
|
if (l == h)
|
|
|
|
break;
|
2020-11-10 20:54:29 +01:00
|
|
|
if (included_patches[m] < n)
|
|
|
|
h = m;
|
|
|
|
else
|
|
|
|
l = m + 1;
|
|
|
|
}
|
2004-06-13 20:20:40 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
2016-01-30 21:29:58 +01:00
|
|
|
ex_version(exarg_T *eap)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Ignore a ":version 9.99" command.
|
|
|
|
*/
|
|
|
|
if (*eap->arg == NUL)
|
|
|
|
{
|
|
|
|
msg_putchar('\n');
|
|
|
|
list_version();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-20 22:01:41 +02:00
|
|
|
/*
|
|
|
|
* Output a string for the version message. If it's going to wrap, output a
|
|
|
|
* newline, unless the message is too long to fit on the screen anyway.
|
|
|
|
* When "wrap" is TRUE wrap the string in [].
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
version_msg_wrap(char_u *s, int wrap)
|
|
|
|
{
|
2021-10-02 11:26:51 +01:00
|
|
|
int len = vim_strsize(s) + (wrap ? 2 : 0);
|
2018-04-20 22:01:41 +02:00
|
|
|
|
|
|
|
if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
|
|
|
|
&& *s != '\n')
|
|
|
|
msg_putchar('\n');
|
|
|
|
if (!got_int)
|
|
|
|
{
|
|
|
|
if (wrap)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts("[");
|
|
|
|
msg_puts((char *)s);
|
2018-04-20 22:01:41 +02:00
|
|
|
if (wrap)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts("]");
|
2018-04-20 22:01:41 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
version_msg(char *s)
|
|
|
|
{
|
|
|
|
version_msg_wrap((char_u *)s, FALSE);
|
|
|
|
}
|
|
|
|
|
2013-02-20 16:47:36 +01:00
|
|
|
/*
|
|
|
|
* List all features aligned in columns, dictionary style.
|
|
|
|
*/
|
|
|
|
static void
|
2016-01-30 21:29:58 +01:00
|
|
|
list_features(void)
|
2018-04-20 22:01:41 +02:00
|
|
|
{
|
|
|
|
list_in_columns((char_u **)features, -1, -1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* List string items nicely aligned in columns.
|
|
|
|
* When "size" is < 0 then the last entry is marked with NULL.
|
|
|
|
* The entry with index "current" is inclosed in [].
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
list_in_columns(char_u **items, int size, int current)
|
2013-02-20 16:47:36 +01:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int ncol;
|
|
|
|
int nrow;
|
2019-07-23 23:00:08 +02:00
|
|
|
int cur_row = 1;
|
2018-04-20 22:01:41 +02:00
|
|
|
int item_count = 0;
|
2013-02-20 16:47:36 +01:00
|
|
|
int width = 0;
|
2019-01-02 17:26:35 +01:00
|
|
|
#ifdef FEAT_SYN_HL
|
|
|
|
int use_highlight = (items == (char_u **)features);
|
|
|
|
#endif
|
2013-02-20 16:47:36 +01:00
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Find the length of the longest item, use that + 1 as the column
|
|
|
|
// width.
|
2018-04-20 22:01:41 +02:00
|
|
|
for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
|
2013-02-20 16:47:36 +01:00
|
|
|
{
|
2021-10-02 11:26:51 +01:00
|
|
|
int l = vim_strsize(items[i]) + (i == current ? 2 : 0);
|
2013-02-20 16:47:36 +01:00
|
|
|
|
|
|
|
if (l > width)
|
|
|
|
width = l;
|
2018-04-20 22:01:41 +02:00
|
|
|
++item_count;
|
2013-02-20 16:47:36 +01:00
|
|
|
}
|
|
|
|
width += 1;
|
|
|
|
|
|
|
|
if (Columns < width)
|
|
|
|
{
|
2019-07-27 21:23:45 +02:00
|
|
|
// Not enough screen columns - show one per line
|
2018-09-18 21:51:47 +02:00
|
|
|
for (i = 0; i < item_count; ++i)
|
2013-02-20 16:47:36 +01:00
|
|
|
{
|
2018-04-20 22:01:41 +02:00
|
|
|
version_msg_wrap(items[i], i == current);
|
2019-07-27 21:23:45 +02:00
|
|
|
if (msg_col > 0 && i < item_count - 1)
|
2013-02-20 16:47:36 +01:00
|
|
|
msg_putchar('\n');
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2019-07-23 23:00:08 +02:00
|
|
|
// The rightmost column doesn't need a separator.
|
|
|
|
// Sacrifice it to fit in one more column if possible.
|
2013-02-26 15:27:23 +01:00
|
|
|
ncol = (int) (Columns + 1) / width;
|
2022-02-03 13:33:03 +00:00
|
|
|
nrow = item_count / ncol + ((item_count % ncol) ? 1 : 0);
|
2013-02-20 16:47:36 +01:00
|
|
|
|
2019-07-27 21:23:45 +02:00
|
|
|
// "i" counts columns then rows. "idx" counts rows then columns.
|
2013-02-20 16:47:36 +01:00
|
|
|
for (i = 0; !got_int && i < nrow * ncol; ++i)
|
|
|
|
{
|
|
|
|
int idx = (i / ncol) + (i % ncol) * nrow;
|
|
|
|
|
2018-04-20 22:01:41 +02:00
|
|
|
if (idx < item_count)
|
2013-02-20 16:47:36 +01:00
|
|
|
{
|
|
|
|
int last_col = (i + 1) % ncol == 0;
|
|
|
|
|
2018-04-20 22:01:41 +02:00
|
|
|
if (idx == current)
|
|
|
|
msg_putchar('[');
|
2019-01-02 17:26:35 +01:00
|
|
|
#ifdef FEAT_SYN_HL
|
|
|
|
if (use_highlight && items[idx][0] == '-')
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts_attr((char *)items[idx], HL_ATTR(HLF_W));
|
2019-01-02 17:26:35 +01:00
|
|
|
else
|
|
|
|
#endif
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts((char *)items[idx]);
|
2018-04-20 22:01:41 +02:00
|
|
|
if (idx == current)
|
|
|
|
msg_putchar(']');
|
2013-02-20 16:47:36 +01:00
|
|
|
if (last_col)
|
|
|
|
{
|
2019-07-23 23:00:08 +02:00
|
|
|
if (msg_col > 0 && cur_row < nrow)
|
2013-02-20 16:47:36 +01:00
|
|
|
msg_putchar('\n');
|
2019-07-23 23:00:08 +02:00
|
|
|
++cur_row;
|
2013-02-20 16:47:36 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
while (msg_col % width)
|
|
|
|
msg_putchar(' ');
|
|
|
|
}
|
|
|
|
}
|
2019-07-25 21:52:39 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// this row is out of items, thus at the end of the row
|
2019-07-27 21:23:45 +02:00
|
|
|
if (msg_col > 0)
|
|
|
|
{
|
|
|
|
if (cur_row < nrow)
|
|
|
|
msg_putchar('\n');
|
|
|
|
++cur_row;
|
|
|
|
}
|
2019-07-25 21:52:39 +02:00
|
|
|
}
|
2013-02-20 16:47:36 +01:00
|
|
|
}
|
|
|
|
}
|
2013-02-26 11:25:33 +01:00
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
void
|
2016-01-30 21:29:58 +01:00
|
|
|
list_version(void)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int first;
|
|
|
|
char *s = "";
|
|
|
|
|
|
|
|
/*
|
|
|
|
* When adding features here, don't forget to update the list of
|
|
|
|
* internal variables in eval.c!
|
|
|
|
*/
|
2018-06-23 16:12:21 +02:00
|
|
|
init_longVersion();
|
2019-01-19 17:43:09 +01:00
|
|
|
msg(longVersion);
|
2019-02-17 17:44:42 +01:00
|
|
|
#ifdef MSWIN
|
|
|
|
# ifdef FEAT_GUI_MSWIN
|
2019-04-28 19:46:49 +02:00
|
|
|
# ifdef VIMDLL
|
|
|
|
# ifdef _WIN64
|
|
|
|
msg_puts(_("\nMS-Windows 64-bit GUI/console version"));
|
|
|
|
# else
|
|
|
|
msg_puts(_("\nMS-Windows 32-bit GUI/console version"));
|
|
|
|
# endif
|
2016-10-12 14:20:24 +02:00
|
|
|
# else
|
2019-04-28 19:46:49 +02:00
|
|
|
# ifdef _WIN64
|
|
|
|
msg_puts(_("\nMS-Windows 64-bit GUI version"));
|
|
|
|
# else
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nMS-Windows 32-bit GUI version"));
|
2019-04-28 19:46:49 +02:00
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
# endif
|
2019-02-17 17:44:42 +01:00
|
|
|
# ifdef FEAT_OLE
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_(" with OLE support"));
|
2019-02-17 17:44:42 +01:00
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
# else
|
2008-06-20 14:32:41 +00:00
|
|
|
# ifdef _WIN64
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nMS-Windows 64-bit console version"));
|
2008-06-20 14:32:41 +00:00
|
|
|
# else
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nMS-Windows 32-bit console version"));
|
2008-06-20 14:32:41 +00:00
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
# endif
|
|
|
|
#endif
|
2017-10-28 21:11:06 +02:00
|
|
|
#if defined(MACOS_X)
|
|
|
|
# if defined(MACOS_X_DARWIN)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nmacOS version"));
|
2017-10-28 21:11:06 +02:00
|
|
|
# else
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nmacOS version w/o darwin feat."));
|
2004-06-13 20:20:40 +00:00
|
|
|
# endif
|
2020-12-21 13:05:57 +01:00
|
|
|
# if defined(__arm64__)
|
|
|
|
msg_puts(" - arm64");
|
|
|
|
# elif defined(__x86_64__)
|
|
|
|
msg_puts(" - x86_64");
|
|
|
|
# endif
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef VMS
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nOpenVMS version"));
|
2006-11-28 16:43:58 +00:00
|
|
|
# ifdef HAVE_PATHDEF
|
|
|
|
if (*compiled_arch != NUL)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(" - ");
|
|
|
|
msg_puts((char *)compiled_arch);
|
2006-11-28 16:43:58 +00:00
|
|
|
}
|
|
|
|
# endif
|
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Print the list of patch numbers if there is at least one.
|
|
|
|
// Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45"
|
2004-06-13 20:20:40 +00:00
|
|
|
if (included_patches[0] != 0)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nIncluded patches: "));
|
2004-06-13 20:20:40 +00:00
|
|
|
first = -1;
|
2021-06-02 13:28:16 +02:00
|
|
|
i = (int)ARRAY_LENGTH(included_patches) - 1;
|
2004-06-13 20:20:40 +00:00
|
|
|
while (--i >= 0)
|
|
|
|
{
|
|
|
|
if (first < 0)
|
|
|
|
first = included_patches[i];
|
|
|
|
if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(s);
|
2004-06-13 20:20:40 +00:00
|
|
|
s = ", ";
|
|
|
|
msg_outnum((long)first);
|
|
|
|
if (first != included_patches[i])
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts("-");
|
2004-06-13 20:20:40 +00:00
|
|
|
msg_outnum((long)included_patches[i]);
|
|
|
|
}
|
|
|
|
first = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Print the list of extra patch descriptions if there is at least one.
|
2008-11-30 11:15:09 +00:00
|
|
|
if (extra_patches[0] != NULL)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nExtra patches: "));
|
2008-11-30 11:15:09 +00:00
|
|
|
s = "";
|
|
|
|
for (i = 0; extra_patches[i] != NULL; ++i)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(s);
|
2008-11-30 11:15:09 +00:00
|
|
|
s = ", ";
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(extra_patches[i]);
|
2008-11-30 11:15:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef MODIFIED_BY
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts("\n");
|
|
|
|
msg_puts(_("Modified by "));
|
|
|
|
msg_puts(MODIFIED_BY);
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef HAVE_PATHDEF
|
|
|
|
if (*compiled_user != NUL || *compiled_sys != NUL)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nCompiled "));
|
2004-06-13 20:20:40 +00:00
|
|
|
if (*compiled_user != NUL)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("by "));
|
|
|
|
msg_puts((char *)compiled_user);
|
2004-06-13 20:20:40 +00:00
|
|
|
}
|
|
|
|
if (*compiled_sys != NUL)
|
|
|
|
{
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts("@");
|
|
|
|
msg_puts((char *)compiled_sys);
|
2004-06-13 20:20:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-04-05 14:18:44 +01:00
|
|
|
#if defined(FEAT_HUGE)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nHuge version "));
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(FEAT_NORMAL)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nNormal version "));
|
2022-04-05 14:18:44 +01:00
|
|
|
#else
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("\nTiny version "));
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
2022-04-05 14:18:44 +01:00
|
|
|
#if !defined(FEAT_GUI)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("without GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(FEAT_GUI_GTK)
|
|
|
|
# if defined(USE_GTK3)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with GTK3 GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
# elif defined(FEAT_GUI_GNOME)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with GTK2-GNOME GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
# else
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with GTK2 GUI."));
|
2016-02-23 17:14:37 +01:00
|
|
|
# endif
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(FEAT_GUI_MOTIF)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with X11-Motif GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(FEAT_GUI_HAIKU)
|
2020-02-26 16:16:53 +01:00
|
|
|
msg_puts(_("with Haiku GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(FEAT_GUI_PHOTON)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with Photon GUI."));
|
2022-04-05 14:18:44 +01:00
|
|
|
#elif defined(MSWIN)
|
2019-01-19 17:43:09 +01:00
|
|
|
msg_puts(_("with GUI."));
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
version_msg(_(" Features included (+) or not (-):\n"));
|
|
|
|
|
2013-02-20 16:47:36 +01:00
|
|
|
list_features();
|
2019-07-26 19:48:19 +02:00
|
|
|
if (msg_col > 0)
|
|
|
|
msg_putchar('\n');
|
2004-06-13 20:20:40 +00:00
|
|
|
|
|
|
|
#ifdef SYS_VIMRC_FILE
|
|
|
|
version_msg(_(" system vimrc file: \""));
|
|
|
|
version_msg(SYS_VIMRC_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#endif
|
|
|
|
#ifdef USR_VIMRC_FILE
|
|
|
|
version_msg(_(" user vimrc file: \""));
|
|
|
|
version_msg(USR_VIMRC_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#endif
|
|
|
|
#ifdef USR_VIMRC_FILE2
|
|
|
|
version_msg(_(" 2nd user vimrc file: \""));
|
|
|
|
version_msg(USR_VIMRC_FILE2);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#endif
|
2024-04-16 20:58:45 +02:00
|
|
|
#if defined(USR_VIMRC_FILE3) && defined(XDG_VIMRC_FILE)
|
2004-06-13 20:20:40 +00:00
|
|
|
version_msg(_(" 3rd user vimrc file: \""));
|
|
|
|
version_msg(USR_VIMRC_FILE3);
|
|
|
|
version_msg("\"\n");
|
2024-04-16 20:58:45 +02:00
|
|
|
version_msg(_(" 4th user vimrc file: \""));
|
|
|
|
version_msg((char *)(XDG_VIMRC_FILE));
|
|
|
|
version_msg("\"\n");
|
|
|
|
#elif defined(USR_VIMRC_FILE3)
|
|
|
|
version_msg(_(" 3rd user vimrc file: \""));
|
|
|
|
version_msg(USR_VIMRC_FILE3);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#elif defined(XDG_VIMRC_FILE)
|
|
|
|
version_msg(_(" 3rd user vimrc file: \""));
|
|
|
|
version_msg((char *)(XDG_VIMRC_FILE));
|
|
|
|
version_msg("\"\n");
|
2004-06-13 20:20:40 +00:00
|
|
|
#endif
|
|
|
|
#ifdef USR_EXRC_FILE
|
|
|
|
version_msg(_(" user exrc file: \""));
|
|
|
|
version_msg(USR_EXRC_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#endif
|
|
|
|
#ifdef USR_EXRC_FILE2
|
|
|
|
version_msg(_(" 2nd user exrc file: \""));
|
|
|
|
version_msg(USR_EXRC_FILE2);
|
|
|
|
version_msg("\"\n");
|
|
|
|
#endif
|
|
|
|
#ifdef FEAT_GUI
|
|
|
|
# ifdef SYS_GVIMRC_FILE
|
|
|
|
version_msg(_(" system gvimrc file: \""));
|
|
|
|
version_msg(SYS_GVIMRC_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
# endif
|
|
|
|
version_msg(_(" user gvimrc file: \""));
|
|
|
|
version_msg(USR_GVIMRC_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
# ifdef USR_GVIMRC_FILE2
|
|
|
|
version_msg(_("2nd user gvimrc file: \""));
|
|
|
|
version_msg(USR_GVIMRC_FILE2);
|
|
|
|
version_msg("\"\n");
|
|
|
|
# endif
|
|
|
|
# ifdef USR_GVIMRC_FILE3
|
|
|
|
version_msg(_("3rd user gvimrc file: \""));
|
|
|
|
version_msg(USR_GVIMRC_FILE3);
|
|
|
|
version_msg("\"\n");
|
|
|
|
# endif
|
|
|
|
#endif
|
2016-07-28 22:24:15 +02:00
|
|
|
version_msg(_(" defaults file: \""));
|
|
|
|
version_msg(VIM_DEFAULTS_FILE);
|
|
|
|
version_msg("\"\n");
|
2004-06-13 20:20:40 +00:00
|
|
|
#ifdef FEAT_GUI
|
|
|
|
# ifdef SYS_MENU_FILE
|
|
|
|
version_msg(_(" system menu file: \""));
|
|
|
|
version_msg(SYS_MENU_FILE);
|
|
|
|
version_msg("\"\n");
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_PATHDEF
|
|
|
|
if (*default_vim_dir != NUL)
|
|
|
|
{
|
|
|
|
version_msg(_(" fall-back for $VIM: \""));
|
|
|
|
version_msg((char *)default_vim_dir);
|
|
|
|
version_msg("\"\n");
|
|
|
|
}
|
|
|
|
if (*default_vimruntime_dir != NUL)
|
|
|
|
{
|
|
|
|
version_msg(_(" f-b for $VIMRUNTIME: \""));
|
|
|
|
version_msg((char *)default_vimruntime_dir);
|
|
|
|
version_msg("\"\n");
|
|
|
|
}
|
|
|
|
version_msg(_("Compilation: "));
|
|
|
|
version_msg((char *)all_cflags);
|
|
|
|
version_msg("\n");
|
|
|
|
#ifdef VMS
|
|
|
|
if (*compiler_version != NUL)
|
|
|
|
{
|
|
|
|
version_msg(_("Compiler: "));
|
|
|
|
version_msg((char *)compiler_version);
|
|
|
|
version_msg("\n");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
version_msg(_("Linking: "));
|
|
|
|
version_msg((char *)all_lflags);
|
|
|
|
#endif
|
|
|
|
#ifdef DEBUG
|
|
|
|
version_msg("\n");
|
|
|
|
version_msg(_(" DEBUG BUILD"));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2016-01-29 22:47:03 +01:00
|
|
|
static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
|
2020-04-05 18:56:05 +02:00
|
|
|
static void intro_message(int colon);
|
2004-06-13 20:20:40 +00:00
|
|
|
|
2013-07-04 22:31:03 +02:00
|
|
|
/*
|
|
|
|
* Show the intro message when not editing a file.
|
|
|
|
*/
|
|
|
|
void
|
2016-01-30 21:29:58 +01:00
|
|
|
maybe_intro_message(void)
|
2013-07-04 22:31:03 +02:00
|
|
|
{
|
2017-03-12 18:23:53 +01:00
|
|
|
if (BUFEMPTY()
|
2013-07-04 22:31:03 +02:00
|
|
|
&& curbuf->b_fname == NULL
|
|
|
|
&& firstwin->w_next == NULL
|
|
|
|
&& vim_strchr(p_shm, SHM_INTRO) == NULL)
|
|
|
|
intro_message(FALSE);
|
|
|
|
}
|
|
|
|
|
2004-06-13 20:20:40 +00:00
|
|
|
/*
|
|
|
|
* Give an introductory message about Vim.
|
|
|
|
* Only used when starting Vim on an empty file, without a file name.
|
|
|
|
* Or with the ":intro" command (for Sven :-).
|
|
|
|
*/
|
2020-04-05 18:56:05 +02:00
|
|
|
static void
|
2016-01-30 21:29:58 +01:00
|
|
|
intro_message(
|
2019-12-21 18:47:26 +01:00
|
|
|
int colon) // TRUE for ":intro"
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
int row;
|
|
|
|
int blanklines;
|
|
|
|
int sponsor;
|
|
|
|
char *p;
|
|
|
|
static char *(lines[]) =
|
|
|
|
{
|
|
|
|
N_("VIM - Vi IMproved"),
|
|
|
|
"",
|
|
|
|
N_("version "),
|
|
|
|
N_("by Bram Moolenaar et al."),
|
|
|
|
#ifdef MODIFIED_BY
|
|
|
|
" ",
|
|
|
|
#endif
|
|
|
|
N_("Vim is open source and freely distributable"),
|
|
|
|
"",
|
|
|
|
N_("Help poor children in Uganda!"),
|
|
|
|
N_("type :help iccf<Enter> for information "),
|
|
|
|
"",
|
|
|
|
N_("type :q<Enter> to exit "),
|
|
|
|
N_("type :help<Enter> or <F1> for on-line help"),
|
2022-06-23 20:46:27 +01:00
|
|
|
N_("type :help version9<Enter> for version info"),
|
2004-06-13 20:20:40 +00:00
|
|
|
NULL,
|
|
|
|
"",
|
|
|
|
N_("Running in Vi compatible mode"),
|
|
|
|
N_("type :set nocp<Enter> for Vim defaults"),
|
|
|
|
N_("type :help cp-default<Enter> for info on this"),
|
|
|
|
};
|
|
|
|
#ifdef FEAT_GUI
|
|
|
|
static char *(gui_lines[]) =
|
|
|
|
{
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
#ifdef MODIFIED_BY
|
|
|
|
NULL,
|
|
|
|
#endif
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
N_("menu Help->Orphans for information "),
|
|
|
|
NULL,
|
|
|
|
N_("Running modeless, typed text is inserted"),
|
|
|
|
N_("menu Edit->Global Settings->Toggle Insert Mode "),
|
|
|
|
N_(" for two modes "),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
N_("menu Edit->Global Settings->Toggle Vi Compatible"),
|
|
|
|
N_(" for Vim defaults "),
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// blanklines = screen height - # message lines
|
2021-06-02 13:28:16 +02:00
|
|
|
blanklines = (int)Rows - (ARRAY_LENGTH(lines) - 1);
|
2004-06-13 20:20:40 +00:00
|
|
|
if (!p_cp)
|
2019-12-21 18:47:26 +01:00
|
|
|
blanklines += 4; // add 4 for not showing "Vi compatible" message
|
2004-06-13 20:20:40 +00:00
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Don't overwrite a statusline. Depends on 'cmdheight'.
|
2004-06-13 20:20:40 +00:00
|
|
|
if (p_ls > 1)
|
|
|
|
blanklines -= Rows - topframe->fr_height;
|
|
|
|
if (blanklines < 0)
|
|
|
|
blanklines = 0;
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Show the sponsor and register message one out of four times, the Uganda
|
|
|
|
// message two out of four times.
|
2005-12-22 22:47:02 +00:00
|
|
|
sponsor = (int)time(NULL);
|
2004-06-13 20:20:40 +00:00
|
|
|
sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// start displaying the message lines after half of the blank lines
|
2004-06-13 20:20:40 +00:00
|
|
|
row = blanklines / 2;
|
|
|
|
if ((row >= 2 && Columns >= 50) || colon)
|
|
|
|
{
|
2021-06-02 13:28:16 +02:00
|
|
|
for (i = 0; i < (int)ARRAY_LENGTH(lines); ++i)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
p = lines[i];
|
|
|
|
#ifdef FEAT_GUI
|
|
|
|
if (p_im && gui.in_use && gui_lines[i] != NULL)
|
|
|
|
p = gui_lines[i];
|
|
|
|
#endif
|
|
|
|
if (p == NULL)
|
|
|
|
{
|
|
|
|
if (!p_cp)
|
|
|
|
break;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (sponsor != 0)
|
|
|
|
{
|
|
|
|
if (strstr(p, "children") != NULL)
|
|
|
|
p = sponsor < 0
|
|
|
|
? N_("Sponsor Vim development!")
|
|
|
|
: N_("Become a registered Vim user!");
|
|
|
|
else if (strstr(p, "iccf") != NULL)
|
|
|
|
p = sponsor < 0
|
|
|
|
? N_("type :help sponsor<Enter> for information ")
|
|
|
|
: N_("type :help register<Enter> for information ");
|
|
|
|
else if (strstr(p, "Orphans") != NULL)
|
|
|
|
p = N_("menu Help->Sponsor/Register for information ");
|
|
|
|
}
|
|
|
|
if (*p != NUL)
|
|
|
|
do_intro_line(row, (char_u *)_(p), i == 2, 0);
|
|
|
|
++row;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Make the wait-return message appear just below the text.
|
2004-06-13 20:20:40 +00:00
|
|
|
if (colon)
|
|
|
|
msg_row = row;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-01-30 21:29:58 +01:00
|
|
|
do_intro_line(
|
|
|
|
int row,
|
|
|
|
char_u *mesg,
|
|
|
|
int add_version,
|
|
|
|
int attr)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
char_u vers[20];
|
|
|
|
int col;
|
|
|
|
char_u *p;
|
|
|
|
int l;
|
|
|
|
int clen;
|
|
|
|
#ifdef MODIFIED_BY
|
|
|
|
# define MODBY_LEN 150
|
|
|
|
char_u modby[MODBY_LEN];
|
|
|
|
|
|
|
|
if (*mesg == ' ')
|
|
|
|
{
|
2008-01-05 12:59:22 +00:00
|
|
|
vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
|
2016-06-01 20:31:43 +02:00
|
|
|
l = (int)STRLEN(modby);
|
2008-01-05 12:59:22 +00:00
|
|
|
vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
|
2004-06-13 20:20:40 +00:00
|
|
|
mesg = modby;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Center the message horizontally.
|
2004-06-13 20:20:40 +00:00
|
|
|
col = vim_strsize(mesg);
|
|
|
|
if (add_version)
|
|
|
|
{
|
|
|
|
STRCPY(vers, mediumVersion);
|
|
|
|
if (highest_patch())
|
|
|
|
{
|
2019-12-21 18:47:26 +01:00
|
|
|
// Check for 9.9x or 9.9xx, alpha/beta version
|
2024-01-04 21:19:04 +01:00
|
|
|
if (SAFE_isalpha((int)vers[3]))
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
2024-01-04 21:19:04 +01:00
|
|
|
int len = (SAFE_isalpha((int)vers[4])) ? 5 : 4;
|
2012-03-07 18:03:10 +01:00
|
|
|
sprintf((char *)vers + len, ".%d%s", highest_patch(),
|
|
|
|
mediumVersion + len);
|
2004-06-13 20:20:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
sprintf((char *)vers + 3, ".%d", highest_patch());
|
|
|
|
}
|
|
|
|
col += (int)STRLEN(vers);
|
|
|
|
}
|
|
|
|
col = (Columns - col) / 2;
|
|
|
|
if (col < 0)
|
|
|
|
col = 0;
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Split up in parts to highlight <> items differently.
|
2004-06-13 20:20:40 +00:00
|
|
|
for (p = mesg; *p != NUL; p += l)
|
|
|
|
{
|
|
|
|
clen = 0;
|
|
|
|
for (l = 0; p[l] != NUL
|
|
|
|
&& (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
|
|
|
|
{
|
|
|
|
if (has_mbyte)
|
|
|
|
{
|
|
|
|
clen += ptr2cells(p + l);
|
2005-08-10 21:07:57 +00:00
|
|
|
l += (*mb_ptr2len)(p + l) - 1;
|
2004-06-13 20:20:40 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
clen += byte2cells(p[l]);
|
|
|
|
}
|
2017-03-16 17:23:31 +01:00
|
|
|
screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
|
2004-06-13 20:20:40 +00:00
|
|
|
col += clen;
|
|
|
|
}
|
|
|
|
|
2019-12-21 18:47:26 +01:00
|
|
|
// Add the version number to the version line.
|
2004-06-13 20:20:40 +00:00
|
|
|
if (add_version)
|
|
|
|
screen_puts(vers, row, col, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ":intro": clear screen, display intro screen and wait for return.
|
|
|
|
*/
|
|
|
|
void
|
2016-01-30 21:29:58 +01:00
|
|
|
ex_intro(exarg_T *eap UNUSED)
|
2004-06-13 20:20:40 +00:00
|
|
|
{
|
|
|
|
screenclear();
|
|
|
|
intro_message(TRUE);
|
|
|
|
wait_return(TRUE);
|
|
|
|
}
|