This worked:
    call setbufvar(str2nr(expand('<abuf>')), "FileNew", 1)

On Sat, Nov 1, 2008 at 9:34 PM, Hari <[EMAIL PROTECTED]> 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
>
>

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

Reply via email to