From c960511c4ee531e436d7e87b118fcb3d234c7014 Mon Sep 17 00:00:00 2001 From: edyfox Date: Tue, 14 Jul 2009 21:59:09 +0000 Subject: [PATCH] Merged from the latest developing branch. git-svn-id: https://vim.svn.sourceforge.net/svnroot/vim/trunk@1565 2a77ed30-b011-0410-a7ad-c7884a0aa172 --- runtime/doc/cmdline.txt | 9 ++++++++- src/getchar.c | 12 +++++------- src/if_perl.xs | 2 ++ src/misc1.c | 24 +++++++++++++++++++----- src/os_mac.h | 1 - src/os_msdos.c | 6 ++++++ src/os_mswin.c | 6 ++++++ src/os_riscos.c | 6 ++++++ src/os_unix.c | 29 ++++++++++++++++++++++++++--- src/os_unix.h | 5 ----- src/proto/os_unix.pro | 1 + src/version.c | 12 ++++++++++++ 12 files changed, 91 insertions(+), 22 deletions(-) diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index 839536b2..c87e61c0 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -441,13 +441,20 @@ between files with almost the same name. If there are multiple matches, those files with an extension that is in the 'suffixes' option are ignored. The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored. -It is impossible to ignore suffixes with two dots. Examples: + +An empty entry, two consecutive commas, match a file name that does not +contain a ".", thus has no suffix. This is useful to ignore "prog" and prefer +"prog.c". + +Examples: pattern: files: match: ~ test* test.c test.h test.o test.c test* test.h test.o test.h and test.o test* test.i test.h test.c test.i and test.c +It is impossible to ignore suffixes with two dots. + If there is more than one matching file (after ignoring the ones matching the 'suffixes' option) the first file name is inserted. You can see that there is only one match when you type 'wildchar' twice and the completed diff --git a/src/getchar.c b/src/getchar.c index e050601c..e81f7cb5 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -3708,11 +3708,10 @@ get_map_mode(cmdp, forceit) * Clear all mappings or abbreviations. * 'abbr' should be FALSE for mappings, TRUE for abbreviations. */ -/*ARGSUSED*/ void map_clear(cmdp, arg, forceit, abbr) char_u *cmdp; - char_u *arg; + char_u *arg UNUSED; int forceit; int abbr; { @@ -3741,13 +3740,12 @@ map_clear(cmdp, arg, forceit, abbr) /* * Clear all mappings in "mode". */ -/*ARGSUSED*/ void map_clear_int(buf, mode, local, abbr) - buf_T *buf; /* buffer for local mappings */ - int mode; /* mode in which to delete */ - int local; /* TRUE for buffer-local mappings */ - int abbr; /* TRUE for abbreviations */ + buf_T *buf UNUSED; /* buffer for local mappings */ + int mode; /* mode in which to delete */ + int local UNUSED; /* TRUE for buffer-local mappings */ + int abbr; /* TRUE for abbreviations */ { mapblock_T *mp, **mpp; int hash; diff --git a/src/if_perl.xs b/src/if_perl.xs index a589f8fd..926adcef 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -720,9 +720,11 @@ ex_perl(eap) #ifdef HAVE_SANDBOX if (sandbox) { +# ifndef MAKE_TEST /* avoid a warning for unreachable code */ if ((safe = perl_get_sv( "VIM::safe", FALSE )) == NULL || !SvTRUE(safe)) EMSG(_("E299: Perl evaluation forbidden in sandbox without the Safe module")); else +# endif { PUSHMARK(SP); XPUSHs(safe); diff --git a/src/misc1.c b/src/misc1.c index 39669b4c..f86a1678 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -8533,11 +8533,25 @@ match_suffix(fname) for (setsuf = p_su; *setsuf; ) { setsuflen = copy_option_part(&setsuf, suf_buf, MAXSUFLEN, ".,"); - if (fnamelen >= setsuflen - && fnamencmp(suf_buf, fname + fnamelen - setsuflen, - (size_t)setsuflen) == 0) - break; - setsuflen = 0; + if (setsuflen == 0) + { + char_u *tail = gettail(fname); + + /* empty entry: match name without a '.' */ + if (vim_strchr(tail, '.') == NULL) + { + setsuflen = 1; + break; + } + } + else + { + if (fnamelen >= setsuflen + && fnamencmp(suf_buf, fname + fnamelen - setsuflen, + (size_t)setsuflen) == 0) + break; + setsuflen = 0; + } } return (setsuflen != 0); } diff --git a/src/os_mac.h b/src/os_mac.h index aadaed77..314ec324 100644 --- a/src/os_mac.h +++ b/src/os_mac.h @@ -291,7 +291,6 @@ # define HAVE_SETENV # define HAVE_RENAME # endif -# define mch_chdir(s) chdir(s) #endif #if defined(MACOS_X) && !defined(HAVE_CONFIG_H) diff --git a/src/os_msdos.c b/src/os_msdos.c index 6748e6a8..0df20c72 100644 --- a/src/os_msdos.c +++ b/src/os_msdos.c @@ -2039,6 +2039,12 @@ mch_chdir(char *path) { if (path[0] == NUL) /* just checking... */ return 0; + if (p_verbose >= 5) + { + verbose_enter(); + smsg((char_u *)"chdir(%s)", path); + verbose_leave(); + } if (path[1] == ':') /* has a drive name */ { if (change_drive(TOLOWER_ASC(path[0]) - 'a' + 1)) diff --git a/src/os_mswin.c b/src/os_mswin.c index 94cf3a96..c3588e6f 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -653,6 +653,12 @@ mch_chdir(char *path) if (path[0] == NUL) /* just checking... */ return -1; + if (p_verbose >= 5) + { + verbose_enter(); + smsg((char_u *)"chdir(%s)", path); + verbose_leave(); + } if (isalpha(path[0]) && path[1] == ':') /* has a drive name */ { /* If we can change to the drive, skip that part of the path. If we diff --git a/src/os_riscos.c b/src/os_riscos.c index 8d6df278..5c443fce 100644 --- a/src/os_riscos.c +++ b/src/os_riscos.c @@ -1203,6 +1203,12 @@ mch_chdir(dir) int retval; char_u *new_dir; + if (p_verbose >= 5) + { + verbose_enter(); + smsg((char_u *)"chdir(%s)", dir); + verbose_leave(); + } length = strlen(dir); if (dir[length - 1] != '.') return chdir(dir); /* No trailing dots - nothing to do. */ diff --git a/src/os_unix.c b/src/os_unix.c index 591b49c9..3aa397bf 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -319,6 +319,23 @@ static struct signalinfo {-1, "Unknown!", FALSE} }; + int +mch_chdir(path) + char *path; +{ + if (p_verbose >= 5) + { + verbose_enter(); + smsg((char_u *)"chdir(%s)", path); + verbose_leave(); + } +# ifdef VMS + return chdir(vms_fixfilename(path)); +# else + return chdir(path); +# endif +} + /* * Write s[len] to the screen. */ @@ -1138,10 +1155,10 @@ mch_suspend() * to happen). */ { - long wait; - for (wait = 0; !sigcont_received && wait <= 3L; wait++) + long wait_time; + for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++) /* Loop is not entered most of the time */ - mch_delay(wait, FALSE); + mch_delay(wait_time, FALSE); } # endif @@ -2424,6 +2441,12 @@ mch_FullName(fname, buf, len, force) #ifdef HAVE_FCHDIR if (fd >= 0) { + if (p_verbose >= 5) + { + verbose_enter(); + MSG("fchdir() to previous dir"); + verbose_leave(); + } l = fchdir(fd); close(fd); } diff --git a/src/os_unix.h b/src/os_unix.h index 944cc1b8..5fd28af7 100644 --- a/src/os_unix.h +++ b/src/os_unix.h @@ -482,11 +482,6 @@ typedef struct dsc$descriptor DESC; # else int mch_rename __ARGS((const char *src, const char *dest)); # endif -# ifdef VMS -# define mch_chdir(s) chdir(vms_fixfilename(s)) -# else -# define mch_chdir(s) chdir(s) -# endif # ifndef VMS # ifdef __MVS__ /* on OS390 Unix getenv() doesn't return a pointer to persistent diff --git a/src/proto/os_unix.pro b/src/proto/os_unix.pro index 36193bb0..e4cad51d 100644 --- a/src/proto/os_unix.pro +++ b/src/proto/os_unix.pro @@ -1,4 +1,5 @@ /* os_unix.c */ +int mch_chdir __ARGS((char *path)); void mch_write __ARGS((char_u *s, int len)); int mch_inchar __ARGS((char_u *buf, int maxlen, long wtime, int tb_change_cnt)); int mch_char_avail __ARGS((void)); diff --git a/src/version.c b/src/version.c index 250bf2d8..3f07803e 100644 --- a/src/version.c +++ b/src/version.c @@ -677,6 +677,18 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 234, +/**/ + 233, +/**/ + 232, +/**/ + 231, +/**/ + 230, +/**/ + 229, +/**/ 228, /**/ 227, -- 2.11.4.GIT