home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.2 / 7.2.259 < prev    next >
Encoding:
Internet Message Format  |  2009-09-10  |  5.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 7.2.259
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.2.259
  11. Problem:    exists() doesn't work properly for an empty aucmd group.
  12. Solution:   Change how au_exists() handles a missing pattern.  Also add a
  13.         test for this. (Bob Hiestand)
  14. Files:        src/fileio.c, src/testdir/Makefile, src/testdir/test67.in,
  15.         src/testdir/test67.ok
  16.  
  17.  
  18. *** ../vim-7.2.258/src/fileio.c    2009-09-11 15:04:13.000000000 +0200
  19. --- src/fileio.c    2009-09-11 16:37:08.000000000 +0200
  20. ***************
  21. *** 9498,9512 ****
  22.       ap = first_autopat[(int)event];
  23.       if (ap == NULL)
  24.       goto theend;
  25. -     if (pattern == NULL)
  26. -     {
  27. -     retval = TRUE;
  28. -     goto theend;
  29. -     }
  30.   
  31.       /* if pattern is "<buffer>", special handling is needed which uses curbuf */
  32.       /* for pattern "<buffer=N>, fnamecmp() will work fine */
  33. !     if (STRICMP(pattern, "<buffer>") == 0)
  34.       buflocal_buf = curbuf;
  35.   
  36.       /* Check if there is an autocommand with the given pattern. */
  37. --- 9498,9507 ----
  38.       ap = first_autopat[(int)event];
  39.       if (ap == NULL)
  40.       goto theend;
  41.   
  42.       /* if pattern is "<buffer>", special handling is needed which uses curbuf */
  43.       /* for pattern "<buffer=N>, fnamecmp() will work fine */
  44. !     if (pattern != NULL && STRICMP(pattern, "<buffer>") == 0)
  45.       buflocal_buf = curbuf;
  46.   
  47.       /* Check if there is an autocommand with the given pattern. */
  48. ***************
  49. *** 9515,9523 ****
  50.       /* For buffer-local autocommands, fnamecmp() works fine. */
  51.       if (ap->pat != NULL && ap->cmds != NULL
  52.           && (group == AUGROUP_ALL || ap->group == group)
  53. !         && (buflocal_buf == NULL
  54. !          ? fnamecmp(ap->pat, pattern) == 0
  55. !          : ap->buflocal_nr == buflocal_buf->b_fnum))
  56.       {
  57.           retval = TRUE;
  58.           break;
  59. --- 9510,9519 ----
  60.       /* For buffer-local autocommands, fnamecmp() works fine. */
  61.       if (ap->pat != NULL && ap->cmds != NULL
  62.           && (group == AUGROUP_ALL || ap->group == group)
  63. !         && (pattern == NULL
  64. !         || (buflocal_buf == NULL
  65. !             ? fnamecmp(ap->pat, pattern) == 0
  66. !             : ap->buflocal_nr == buflocal_buf->b_fnum)))
  67.       {
  68.           retval = TRUE;
  69.           break;
  70. *** ../vim-7.2.258/src/testdir/Makefile    2009-06-24 18:07:55.000000000 +0200
  71. --- src/testdir/Makefile    2009-09-11 16:31:33.000000000 +0200
  72. ***************
  73. *** 22,28 ****
  74.           test48.out test49.out test51.out test52.out test53.out \
  75.           test54.out test55.out test56.out test57.out test58.out \
  76.           test59.out test60.out test61.out test62.out test63.out \
  77. !         test64.out test65.out test66.out
  78.   
  79.   SCRIPTS_GUI = test16.out
  80.   
  81. --- 22,28 ----
  82.           test48.out test49.out test51.out test52.out test53.out \
  83.           test54.out test55.out test56.out test57.out test58.out \
  84.           test59.out test60.out test61.out test62.out test63.out \
  85. !         test64.out test65.out test66.out test67.out
  86.   
  87.   SCRIPTS_GUI = test16.out
  88.   
  89. *** ../vim-7.2.258/src/testdir/test67.in    2009-09-11 17:23:47.000000000 +0200
  90. --- src/testdir/test67.in    2009-09-11 16:43:11.000000000 +0200
  91. ***************
  92. *** 0 ****
  93. --- 1,33 ----
  94. + Test that groups and patterns are tested correctly when calling exists() for
  95. + autocommands.
  96. + STARTTEST
  97. + :so small.vim
  98. + :let results=[]
  99. + :augroup auexists
  100. + :augroup END
  101. + :call add(results, "##BufEnter: " . exists("##BufEnter"))
  102. + :call add(results, "#BufEnter: " . exists("#BufEnter"))
  103. + :au BufEnter * let g:entered=1
  104. + :call add(results, "#BufEnter: " . exists("#BufEnter"))
  105. + :call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
  106. + :augroup auexists
  107. + :au BufEnter * let g:entered=1
  108. + :augroup END
  109. + :call add(results, "#auexists#BufEnter: " . exists("#auexists#BufEnter"))
  110. + :call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
  111. + :au BufEnter *.test let g:entered=1
  112. + :call add(results, "#BufEnter#*.test: " . exists("#BufEnter#*.test"))
  113. + :edit testfile.test
  114. + :call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
  115. + :au BufEnter <buffer> let g:entered=1
  116. + :call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
  117. + :edit testfile2.test
  118. + :call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
  119. + :e test.out
  120. + :call append(0, results)
  121. + :$d
  122. + :w
  123. + :qa!
  124. + ENDTEST
  125. *** ../vim-7.2.258/src/testdir/test67.ok    2009-09-11 17:23:47.000000000 +0200
  126. --- src/testdir/test67.ok    2009-09-11 16:43:15.000000000 +0200
  127. ***************
  128. *** 0 ****
  129. --- 1,10 ----
  130. + ##BufEnter: 1
  131. + #BufEnter: 0
  132. + #BufEnter: 1
  133. + #auexists#BufEnter: 0
  134. + #auexists#BufEnter: 1
  135. + #BufEnter#*.test: 0
  136. + #BufEnter#*.test: 1
  137. + #BufEnter#<buffer>: 0
  138. + #BufEnter#<buffer>: 1
  139. + #BufEnter#<buffer>: 0
  140. *** ../vim-7.2.258/src/version.c    2009-09-11 16:48:06.000000000 +0200
  141. --- src/version.c    2009-09-11 17:23:14.000000000 +0200
  142. ***************
  143. *** 678,679 ****
  144. --- 678,681 ----
  145.   {   /* Add new patch number below this line */
  146. + /**/
  147. +     259,
  148.   /**/
  149.  
  150. -- 
  151. hundred-and-one symptoms of being an internet addict:
  152. 234. You started college as a chemistry major, and walk out four years
  153.      later as an Internet provider.
  154.  
  155.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  156. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  157. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  158.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  159.