On 02/11/08 05:34, Hari wrote:
> I'm trying to setup an event that will mark a buffer variable upon
> creation (tabnew, tabe [no filename]). The code below sets the variable
> for the current active buffer, not for the new one that is being
> created. Am I doing something that is even possible?
>
>
> autocmd BufCreate * call HandleFileNewEvent()
>
> function! HandleFileNewEvent()
> " Mark file as new
> " try different tricks to find the right buffer
>
> " this sets the variable for the current buffer //ERROR
> let b:FileNew = 1
>
> " This complains that the buffer number is not found, ls later shows
> that the number is correct... too early? // ERROR
> call setbufvar(expand("<abuf>"), "FileNew1", 1)
>
> endfunction
>
>
>
>
> Thanks!
> Hari

The fact that the current buffer is not the buffer being created is 
documented under ":help BufCreate".

Have you tried not using expand()?

        call setbufvar("<abuf>", "FileNew1", 1)


Best regards,
Tony.
-- 
The study of non-linear physics is like the study of non-elephant
biology.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to