0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.0278: the +wildignore feature is nearly always available

Problem:    The +wildignore feature is nearly always available.
Solution:   Graduate +wildignore for consistency.
This commit is contained in:
Bram Moolenaar
2022-08-26 16:41:14 +01:00
parent c361842f14
commit 074fbd4131
11 changed files with 17 additions and 57 deletions

View File

@@ -1177,8 +1177,6 @@ A jump table for the options with a short description can be found at |Q_op|.
Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*" Unix: "/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*"
Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*") Mac: "/private/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*")
global global
{not available when compiled without the |+wildignore|
feature}
A list of file patterns. When one of the patterns matches with the A list of file patterns. When one of the patterns matches with the
name of the file which is written, no backup file is created. Both name of the file which is written, no backup file is created. Both
the specified file name and the full path name of the file are used. the specified file name and the full path name of the file are used.
@@ -9024,8 +9022,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'wildignore'* *'wig'* *'wildignore'* *'wig'*
'wildignore' 'wig' string (default "") 'wildignore' 'wig' string (default "")
global global
{not available when compiled without the |+wildignore|
feature}
A list of file patterns. A file that matches with one of these A list of file patterns. A file that matches with one of these
patterns is ignored when expanding |wildcards|, completing file or patterns is ignored when expanding |wildcards|, completing file or
directory names, and influences the result of |expand()|, |glob()| and directory names, and influences the result of |expand()|, |glob()| and
@@ -9156,8 +9152,6 @@ A jump table for the options with a short description can be found at |Q_op|.
*'wildoptions'* *'wop'* *'wildoptions'* *'wop'*
'wildoptions' 'wop' string (default "") 'wildoptions' 'wop' string (default "")
global global
{not available when compiled without the |+wildignore|
feature}
A list of words that change how |cmdline-completion| is done. A list of words that change how |cmdline-completion| is done.
The following values are supported: The following values are supported:
fuzzy Use |fuzzy-matching| to find completion matches. When fuzzy Use |fuzzy-matching| to find completion matches. When

View File

@@ -490,7 +490,7 @@ T *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
T *+visualextra* extra Visual mode commands |blockwise-operators| T *+visualextra* extra Visual mode commands |blockwise-operators|
T *+vreplace* |gR| and |gr| T *+vreplace* |gR| and |gr|
*+vtp* on MS-Windows console: support for 'termguicolors' *+vtp* on MS-Windows console: support for 'termguicolors'
N *+wildignore* |'wildignore'| T *+wildignore* |'wildignore'| Always enabled since 9.0.0278
N *+wildmenu* |'wildmenu'| N *+wildmenu* |'wildmenu'|
T *+windows* more than one window; Always enabled since 8.0.1118. T *+windows* more than one window; Always enabled since 8.0.1118.
m *+writebackup* |'writebackup'| is default on m *+writebackup* |'writebackup'| is default on

View File

@@ -1136,10 +1136,8 @@ buf_write(
// If 'backupskip' is not empty, don't make a backup for some files. // If 'backupskip' is not empty, don't make a backup for some files.
dobackup = (p_wb || p_bk || *p_pm != NUL); dobackup = (p_wb || p_bk || *p_pm != NUL);
#ifdef FEAT_WILDIGN
if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname)) if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname))
dobackup = FALSE; dobackup = FALSE;
#endif
// Save the value of got_int and reset it. We don't want a previous // Save the value of got_int and reset it. We don't want a previous
// interruption cancel writing, only hitting CTRL-C while writing should // interruption cancel writing, only hitting CTRL-C while writing should

View File

@@ -6260,13 +6260,7 @@ f_has(typval_T *argvars, typval_T *rettv)
0 0
#endif #endif
}, },
{"wildignore", {"wildignore", 1},
#ifdef FEAT_WILDIGN
1
#else
0
#endif
},
{"wildmenu", {"wildmenu",
#ifdef FEAT_WILDMENU #ifdef FEAT_WILDMENU
1 1

View File

@@ -118,6 +118,7 @@
* +textobjects Text objects: "vaw", "das", etc. * +textobjects Text objects: "vaw", "das", etc.
* +file_in_path "gf" and "<cfile>" commands. * +file_in_path "gf" and "<cfile>" commands.
* +path_extra up/downwards searching in 'path' and 'tags'. * +path_extra up/downwards searching in 'path' and 'tags'.
* +wildignore 'wildignore' and 'backupskip' options
* *
* Obsolete: * Obsolete:
* +tag_old_static Old style static tags: "file:tag file ..". * +tag_old_static Old style static tags: "file:tag file ..".
@@ -285,7 +286,7 @@
/* /*
* +timers timer_start() * +timers timer_start()
*/ */
#if defined(FEAT_RELTIME) && (defined(UNIX) || defined(MSWIN) || defined(VMS) ) #if defined(FEAT_RELTIME) && (defined(UNIX) || defined(MSWIN) || defined(VMS))
# define FEAT_TIMERS # define FEAT_TIMERS
#endif #endif
@@ -337,14 +338,6 @@
# define FEAT_BYTEOFF # define FEAT_BYTEOFF
#endif #endif
/*
* +wildignore 'wildignore' and 'backupskip' options
* Needed for Unix to make "crontab -e" work.
*/
#if defined(FEAT_NORMAL) || defined(UNIX)
# define FEAT_WILDIGN
#endif
/* /*
* +wildmenu 'wildmenu' option * +wildmenu 'wildmenu' option
*/ */

View File

@@ -312,7 +312,9 @@ readfile(
curbuf->b_op_start = orig_start; curbuf->b_op_start = orig_start;
if (flags & READ_NOFILE) if (flags & READ_NOFILE)
return NOTDONE; // so that BufEnter can be triggered // Return NOTDONE instead of FAIL so that BufEnter can be triggered
// and other operations don't fail.
return NOTDONE;
} }
if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0)
@@ -5402,7 +5404,6 @@ match_file_pat(
return result; return result;
} }
#if defined(FEAT_WILDIGN) || defined(PROTO)
/* /*
* Return TRUE if a file matches with a pattern in "list". * Return TRUE if a file matches with a pattern in "list".
* "list" is a comma-separated list of patterns, like 'wildignore'. * "list" is a comma-separated list of patterns, like 'wildignore'.
@@ -5436,7 +5437,6 @@ match_file_list(char_u *list, char_u *sfname, char_u *ffname)
} }
return FALSE; return FALSE;
} }
#endif
/* /*
* Convert the given pattern "pat" which has shell style wildcards in it, into * Convert the given pattern "pat" which has shell style wildcards in it, into

View File

@@ -3136,7 +3136,6 @@ expand_wildcards(
if ((flags & EW_KEEPALL) || retval == FAIL) if ((flags & EW_KEEPALL) || retval == FAIL)
return retval; return retval;
#ifdef FEAT_WILDIGN
/* /*
* Remove names that match 'wildignore'. * Remove names that match 'wildignore'.
*/ */
@@ -3172,7 +3171,6 @@ expand_wildcards(
return FAIL; return FAIL;
} }
} }
#endif
/* /*
* Move the names where 'suffixes' match to the end. * Move the names where 'suffixes' match to the end.

View File

@@ -126,17 +126,16 @@ set_init_1(int clean_arg)
set_string_default_esc("sh", p, TRUE); set_string_default_esc("sh", p, TRUE);
#endif #endif
#ifdef FEAT_WILDIGN
/* /*
* Set the default for 'backupskip' to include environment variables for * Set the default for 'backupskip' to include environment variables for
* temp files. * temp files.
*/ */
{ {
# ifdef UNIX #ifdef UNIX
static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"}; static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"};
# else #else
static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"}; static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"};
# endif #endif
int len; int len;
garray_T ga; garray_T ga;
int mustfree; int mustfree;
@@ -148,15 +147,15 @@ set_init_1(int clean_arg)
for (n = 0; n < (long)ARRAY_LENGTH(names); ++n) for (n = 0; n < (long)ARRAY_LENGTH(names); ++n)
{ {
mustfree = FALSE; mustfree = FALSE;
# ifdef UNIX #ifdef UNIX
if (*names[n] == NUL) if (*names[n] == NUL)
# ifdef MACOS_X # ifdef MACOS_X
p = (char_u *)"/private/tmp"; p = (char_u *)"/private/tmp";
# else # else
p = (char_u *)"/tmp"; p = (char_u *)"/tmp";
# endif
else
# endif # endif
else
#endif
p = vim_getenv((char_u *)names[n], &mustfree); p = vim_getenv((char_u *)names[n], &mustfree);
if (p != NULL && *p != NUL) if (p != NULL && *p != NUL)
{ {
@@ -186,7 +185,6 @@ set_init_1(int clean_arg)
vim_free(ga.ga_data); vim_free(ga.ga_data);
} }
} }
#endif
/* /*
* 'maxmemtot' and 'maxmem' may have to be adjusted for available memory * 'maxmemtot' and 'maxmem' may have to be adjusted for available memory

View File

@@ -451,9 +451,7 @@ EXTERN unsigned bo_flags;
#define BO_TERM 0x40000 #define BO_TERM 0x40000
#define BO_WILD 0x80000 #define BO_WILD 0x80000
#ifdef FEAT_WILDIGN
EXTERN char_u *p_bsk; // 'backupskip' EXTERN char_u *p_bsk; // 'backupskip'
#endif
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
EXTERN char_u *p_cm; // 'cryptmethod' EXTERN char_u *p_cm; // 'cryptmethod'
#endif #endif
@@ -1061,9 +1059,7 @@ EXTERN long p_window; // 'window'
#define FEAT_WAK #define FEAT_WAK
EXTERN char_u *p_wak; // 'winaltkeys' EXTERN char_u *p_wak; // 'winaltkeys'
#endif #endif
#ifdef FEAT_WILDIGN
EXTERN char_u *p_wig; // 'wildignore' EXTERN char_u *p_wig; // 'wildignore'
#endif
EXTERN int p_wiv; // 'weirdinvert' EXTERN int p_wiv; // 'weirdinvert'
EXTERN char_u *p_ww; // 'whichwrap' EXTERN char_u *p_ww; // 'whichwrap'
EXTERN long p_wc; // 'wildchar' EXTERN long p_wc; // 'wildchar'

View File

@@ -427,13 +427,8 @@ static struct vimoption options[] =
#endif #endif
(char_u *)0L} SCTX_INIT}, (char_u *)0L} SCTX_INIT},
{"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_WILDIGN
(char_u *)&p_bsk, PV_NONE, (char_u *)&p_bsk, PV_NONE,
{(char_u *)"", (char_u *)0L} {(char_u *)"", (char_u *)0L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)0L, (char_u *)0L}
#endif
SCTX_INIT}, SCTX_INIT},
{"balloondelay","bdlay",P_NUM|P_VI_DEF, {"balloondelay","bdlay",P_NUM|P_VI_DEF,
#ifdef FEAT_BEVAL #ifdef FEAT_BEVAL
@@ -2757,11 +2752,7 @@ static struct vimoption options[] =
(char_u *)&p_wcm, PV_NONE, (char_u *)&p_wcm, PV_NONE,
{(char_u *)0L, (char_u *)0L} SCTX_INIT}, {(char_u *)0L, (char_u *)0L} SCTX_INIT},
{"wildignore", "wig", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, {"wildignore", "wig", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP,
#ifdef FEAT_WILDIGN
(char_u *)&p_wig, PV_NONE, (char_u *)&p_wig, PV_NONE,
#else
(char_u *)NULL, PV_NONE,
#endif
{(char_u *)"", (char_u *)0L} SCTX_INIT}, {(char_u *)"", (char_u *)0L} SCTX_INIT},
{"wildignorecase", "wic", P_BOOL|P_VI_DEF, {"wildignorecase", "wic", P_BOOL|P_VI_DEF,
(char_u *)&p_wic, PV_NONE, (char_u *)&p_wic, PV_NONE,

View File

@@ -655,11 +655,7 @@ static char *(features[]) =
"-vtp", "-vtp",
# endif # endif
#endif #endif
#ifdef FEAT_WILDIGN
"+wildignore", "+wildignore",
#else
"-wildignore",
#endif
#ifdef FEAT_WILDMENU #ifdef FEAT_WILDMENU
"+wildmenu", "+wildmenu",
#else #else
@@ -723,6 +719,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
278,
/**/ /**/
277, 277,
/**/ /**/