Dasn wrote:
> Accessing buffer in 'BufDelete' or 'BufWipeout' autocmd makes hidden
> buffer displayed. Here's the test code:
>
> fun! WipeOutAll()
> for i in range(1, bufnr('$'))
> exe "silent! bw" i
> endfor
> endfun
> fun! OnRemoving()
> let name = expand('<afile>')
> exe "b" name
> call append("$", "Refuse to die")
> endfun
>
> sp buffer1
> au BufWipeout <buffer> call OnRemoving()
> sp buffer2
> au BufWipeout <buffer> call OnRemoving()
>
> call WipeOutAll()
>
> This code shows 2 unexpected behaviors:
> 1) After ":source" this test script, ":ls" reports:
> 2 %h + "buffer1" line 1
> but the doc says 'hidden' buffers are not displayed.
>
> 2) Both "Refuse to die" lines goes into one buffer, but I think they
> should be dispatched to each buffer (I mean one line per buffer) before
> they are being wiped out.
You are shooting yourself in the foot. In the BufWipeout command you
should not start editing another buffer, weird things may happen, such
as wiping out the wrong buffer.
I'll see if I can catch the situation and give an error message.
--
ROBIN: (warily) And if you get a question wrong?
ARTHUR: You are cast into the Gorge of Eternal Peril.
ROBIN: Oh ... wacho!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---