diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-26 16:41:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-26 16:41:14 +0100 |
commit | 074fbd413172edc6f4936296a28bf8fd5cdfa38b (patch) | |
tree | 1c1f0e8682516840548e2b317e4a929c53ff9250 /src | |
parent | c361842f1479a7f7f3e65bfb0e188f2e5d38336e (diff) |
patch 9.0.0278: the +wildignore feature is nearly always availablev9.0.0278
Problem: The +wildignore feature is nearly always available.
Solution: Graduate +wildignore for consistency.
Diffstat (limited to 'src')
-rw-r--r-- | src/bufwrite.c | 2 | ||||
-rw-r--r-- | src/evalfunc.c | 8 | ||||
-rw-r--r-- | src/feature.h | 11 | ||||
-rw-r--r-- | src/fileio.c | 6 | ||||
-rw-r--r-- | src/filepath.c | 2 | ||||
-rw-r--r-- | src/option.c | 18 | ||||
-rw-r--r-- | src/option.h | 4 | ||||
-rw-r--r-- | src/optiondefs.h | 9 | ||||
-rw-r--r-- | src/version.c | 6 |
9 files changed, 16 insertions, 50 deletions
diff --git a/src/bufwrite.c b/src/bufwrite.c index 5db8f2983b..b283b5eb64 100644 --- a/src/bufwrite.c +++ b/src/bufwrite.c @@ -1136,10 +1136,8 @@ buf_write( // If 'backupskip' is not empty, don't make a backup for some files. dobackup = (p_wb || p_bk || *p_pm != NUL); -#ifdef FEAT_WILDIGN if (dobackup && *p_bsk != NUL && match_file_list(p_bsk, sfname, ffname)) dobackup = FALSE; -#endif // 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 diff --git a/src/evalfunc.c b/src/evalfunc.c index b3084f3358..a41e6758af 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -6260,13 +6260,7 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, - {"wildignore", -#ifdef FEAT_WILDIGN - 1 -#else - 0 -#endif - }, + {"wildignore", 1}, {"wildmenu", #ifdef FEAT_WILDMENU 1 diff --git a/src/feature.h b/src/feature.h index bffd80a919..529ada57a1 100644 --- a/src/feature.h +++ b/src/feature.h @@ -118,6 +118,7 @@ * +textobjects Text objects: "vaw", "das", etc. * +file_in_path "gf" and "<cfile>" commands. * +path_extra up/downwards searching in 'path' and 'tags'. + * +wildignore 'wildignore' and 'backupskip' options * * Obsolete: * +tag_old_static Old style static tags: "file:tag file ..". @@ -285,7 +286,7 @@ /* * +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 #endif @@ -338,14 +339,6 @@ #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 */ #if defined(FEAT_NORMAL) diff --git a/src/fileio.c b/src/fileio.c index 8437b2b447..701521a419 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -312,7 +312,9 @@ readfile( curbuf->b_op_start = orig_start; 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) @@ -5402,7 +5404,6 @@ match_file_pat( return result; } -#if defined(FEAT_WILDIGN) || defined(PROTO) /* * Return TRUE if a file matches with a pattern in "list". * "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; } -#endif /* * Convert the given pattern "pat" which has shell style wildcards in it, into diff --git a/src/filepath.c b/src/filepath.c index f61603fa6f..646a25e62e 100644 --- a/src/filepath.c +++ b/src/filepath.c @@ -3136,7 +3136,6 @@ expand_wildcards( if ((flags & EW_KEEPALL) || retval == FAIL) return retval; -#ifdef FEAT_WILDIGN /* * Remove names that match 'wildignore'. */ @@ -3172,7 +3171,6 @@ expand_wildcards( return FAIL; } } -#endif /* * Move the names where 'suffixes' match to the end. diff --git a/src/option.c b/src/option.c index 05e0527cd3..3e1473fc95 100644 --- a/src/option.c +++ b/src/option.c @@ -126,17 +126,16 @@ set_init_1(int clean_arg) set_string_default_esc("sh", p, TRUE); #endif -#ifdef FEAT_WILDIGN /* * Set the default for 'backupskip' to include environment variables for * temp files. */ { -# ifdef UNIX +#ifdef UNIX static char *(names[4]) = {"", "TMPDIR", "TEMP", "TMP"}; -# else +#else static char *(names[3]) = {"TMPDIR", "TEMP", "TMP"}; -# endif +#endif int len; garray_T ga; int mustfree; @@ -148,15 +147,15 @@ set_init_1(int clean_arg) for (n = 0; n < (long)ARRAY_LENGTH(names); ++n) { mustfree = FALSE; -# ifdef UNIX +#ifdef UNIX if (*names[n] == NUL) -# ifdef MACOS_X +# ifdef MACOS_X p = (char_u *)"/private/tmp"; -# else +# else p = (char_u *)"/tmp"; -# endif - else # endif + else +#endif p = vim_getenv((char_u *)names[n], &mustfree); if (p != NULL && *p != NUL) { @@ -186,7 +185,6 @@ set_init_1(int clean_arg) vim_free(ga.ga_data); } } -#endif /* * 'maxmemtot' and 'maxmem' may have to be adjusted for available memory diff --git a/src/option.h b/src/option.h index d40dcb5ea5..aeb80ce431 100644 --- a/src/option.h +++ b/src/option.h @@ -451,9 +451,7 @@ EXTERN unsigned bo_flags; #define BO_TERM 0x40000 #define BO_WILD 0x80000 -#ifdef FEAT_WILDIGN EXTERN char_u *p_bsk; // 'backupskip' -#endif #ifdef FEAT_CRYPT EXTERN char_u *p_cm; // 'cryptmethod' #endif @@ -1061,9 +1059,7 @@ EXTERN long p_window; // 'window' #define FEAT_WAK EXTERN char_u *p_wak; // 'winaltkeys' #endif -#ifdef FEAT_WILDIGN EXTERN char_u *p_wig; // 'wildignore' -#endif EXTERN int p_wiv; // 'weirdinvert' EXTERN char_u *p_ww; // 'whichwrap' EXTERN long p_wc; // 'wildchar' diff --git a/src/optiondefs.h b/src/optiondefs.h index de63ceb4ab..099ad2e95b 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -427,13 +427,8 @@ static struct vimoption options[] = #endif (char_u *)0L} SCTX_INIT}, {"backupskip", "bsk", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, -#ifdef FEAT_WILDIGN (char_u *)&p_bsk, PV_NONE, {(char_u *)"", (char_u *)0L} -#else - (char_u *)NULL, PV_NONE, - {(char_u *)0L, (char_u *)0L} -#endif SCTX_INIT}, {"balloondelay","bdlay",P_NUM|P_VI_DEF, #ifdef FEAT_BEVAL @@ -2757,11 +2752,7 @@ static struct vimoption options[] = (char_u *)&p_wcm, PV_NONE, {(char_u *)0L, (char_u *)0L} SCTX_INIT}, {"wildignore", "wig", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, -#ifdef FEAT_WILDIGN (char_u *)&p_wig, PV_NONE, -#else - (char_u *)NULL, PV_NONE, -#endif {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"wildignorecase", "wic", P_BOOL|P_VI_DEF, (char_u *)&p_wic, PV_NONE, diff --git a/src/version.c b/src/version.c index 1fd798b8fa..9088962d84 100644 --- a/src/version.c +++ b/src/version.c @@ -655,11 +655,7 @@ static char *(features[]) = "-vtp", # endif #endif -#ifdef FEAT_WILDIGN "+wildignore", -#else - "-wildignore", -#endif #ifdef FEAT_WILDMENU "+wildmenu", #else @@ -724,6 +720,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 278, +/**/ 277, /**/ 276, |