]> granicus.if.org Git - vim/commitdiff
updated for version 7.2-259 v7.2.259
authorBram Moolenaar <Bram@vim.org>
Fri, 11 Sep 2009 15:24:31 +0000 (15:24 +0000)
committerBram Moolenaar <Bram@vim.org>
Fri, 11 Sep 2009 15:24:31 +0000 (15:24 +0000)
src/fileio.c
src/testdir/Makefile
src/testdir/test67.in [new file with mode: 0644]
src/testdir/test67.ok [new file with mode: 0644]
src/version.c

index 46d364a67e816e566c89e009fece6e91723a2d3d..5deb1a3984f13c320dbe27623d1c568205d3e948 100644 (file)
@@ -9498,15 +9498,10 @@ au_exists(arg)
     ap = first_autopat[(int)event];
     if (ap == NULL)
        goto theend;
-    if (pattern == NULL)
-    {
-       retval = TRUE;
-       goto theend;
-    }
 
     /* if pattern is "<buffer>", special handling is needed which uses curbuf */
     /* for pattern "<buffer=N>, fnamecmp() will work fine */
-    if (STRICMP(pattern, "<buffer>") == 0)
+    if (pattern != NULL && STRICMP(pattern, "<buffer>") == 0)
        buflocal_buf = curbuf;
 
     /* Check if there is an autocommand with the given pattern. */
@@ -9515,9 +9510,10 @@ au_exists(arg)
        /* For buffer-local autocommands, fnamecmp() works fine. */
        if (ap->pat != NULL && ap->cmds != NULL
            && (group == AUGROUP_ALL || ap->group == group)
-           && (buflocal_buf == NULL
-                ? fnamecmp(ap->pat, pattern) == 0
-                : ap->buflocal_nr == buflocal_buf->b_fnum))
+           && (pattern == NULL
+               || (buflocal_buf == NULL
+                   ? fnamecmp(ap->pat, pattern) == 0
+                   : ap->buflocal_nr == buflocal_buf->b_fnum)))
        {
            retval = TRUE;
            break;
index 50386ec7750e7697be4e081259957a2fce82954d..8f9fd1356107af3aa07cc161d218e46acc4aebaf 100644 (file)
@@ -22,7 +22,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
                test48.out test49.out test51.out test52.out test53.out \
                test54.out test55.out test56.out test57.out test58.out \
                test59.out test60.out test61.out test62.out test63.out \
-               test64.out test65.out test66.out
+               test64.out test65.out test66.out test67.out
 
 SCRIPTS_GUI = test16.out
 
diff --git a/src/testdir/test67.in b/src/testdir/test67.in
new file mode 100644 (file)
index 0000000..08b4e37
--- /dev/null
@@ -0,0 +1,33 @@
+Test that groups and patterns are tested correctly when calling exists() for
+autocommands.
+
+STARTTEST
+:so small.vim
+:let results=[]
+:augroup auexists
+:augroup END
+:call add(results, "##BufEnter: " . exists("##BufEnter"))
+:call add(results, "#BufEnter: " . exists("#BufEnter"))
+:au BufEnter * let g:entered=1
+:call add(results, "#BufEnter: " . exists("#BufEnter"))
+:call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
+:augroup auexists
+:au BufEnter * let g:entered=1
+:augroup END
+:call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
+:call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
+:au BufEnter *.test let g:entered=1
+:call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
+:edit testfile.test
+:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
+:au BufEnter <buffer> let g:entered=1
+:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
+:edit testfile2.test
+:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
+:e test.out
+:call append(0, results)
+:$d
+:w
+:qa!
+ENDTEST
+
diff --git a/src/testdir/test67.ok b/src/testdir/test67.ok
new file mode 100644 (file)
index 0000000..51188e5
--- /dev/null
@@ -0,0 +1,10 @@
+##BufEnter: 1
+#BufEnter: 0
+#BufEnter: 1
+#auexists#BufEnter: 0
+#auexists#BufEnter: 1
+#BufEnter#*.test: 0
+#BufEnter#*.test: 1
+#BufEnter#<buffer>: 0
+#BufEnter#<buffer>: 1
+#BufEnter#<buffer>: 0
index 654b350288ee9838cb17ee4ffba6e578d2bf4a5b..f88a757c6b9f0fe46780bc98074037c9e916afa9 100644 (file)
@@ -676,6 +676,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    259,
 /**/
     258,
 /**/