]> granicus.if.org Git - vim/commitdiff
updated for version 7.4b.006 v7.4b.006
authorBram Moolenaar <Bram@vim.org>
Fri, 2 Aug 2013 13:22:39 +0000 (15:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Fri, 2 Aug 2013 13:22:39 +0000 (15:22 +0200)
Problem:    Using \{n,m} in an autocommand pattern no longer works.
            Specifically, mutt temp files are not recognized. (Gary Johnson)
Solution:   Make \\\{n,m\} work.

runtime/doc/autocmd.txt
src/fileio.c
src/version.c

index 4d7a4260ed957a070efe6a177f49bb9ce4e151d2..543c1df5c1c94f7f27289a6dc7781ef991859036 100644 (file)
@@ -961,6 +961,9 @@ The pattern is interpreted like mostly used in file names:
        \,      matches a ','
        { }     like \( \) in a |pattern|
        ,       inside { }: like \| in a |pattern|
+       \}      literal }
+       \{      literal {
+       \\\{n,m\}  like \{n,m} in a |pattern|
        \       special meaning like in a |pattern|
        [ch]    matches 'c' or 'h'
        [^ch]   match any character but 'c' and 'h'
index fe90246fd387479ed523e8cb711c17c04bc10fc6..731a7b183d1e0a99965c1b8c12e473615318ece3 100644 (file)
@@ -10327,7 +10327,7 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
                 * Don't unescape \, * and others that are also special in a
                 * regexp.
                 * An escaped { must be unescaped since we use magic not
-                * verymagic.
+                * verymagic.  Use "\\\{n,m\}"" to get "\{n,m}".
                 */
                if (*++p == '?'
 #ifdef BACKSLASH_IN_FILENAME
@@ -10337,8 +10337,14 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
                    reg_pat[i++] = '?';
                else
                    if (*p == ',' || *p == '%' || *p == '#'
-                                                   || *p == ' ' || *p == '{')
+                                      || *p == ' ' || *p == '{' || *p == '}')
                        reg_pat[i++] = *p;
+                   else if (*p == '\\' && p[1] == '\\' && p[2] == '{')
+                   {
+                       reg_pat[i++] = '\\';
+                       reg_pat[i++] = '{';
+                       p += 2;
+                   }
                    else
                    {
                        if (allow_dirs != NULL && vim_ispathsep(*p)
index ec2c2c0002c3525b4a900d9bfb4830866411e475..77c3e8d571cd2d2d928b5688f2f14030813fad9d 100644 (file)
@@ -727,6 +727,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    6,
 /**/
     5,
 /**/