> On Jun 3, 1:54 am, Tinou <tinou...@gmail.com> wrote:
>> Now this seems to work:
>>
>> autocmd! BufNew * if empty(expand("<afile>")) | call
>> setbufvar(bufnr("$"), "&buftype", "nofile") | endif
>>
>> I'm not very happy with the bufnr("$"), but bufnr("<afile>") returns
>> -1. Can I rely, in this case for the <afile> to always be the last
>> buffer ? Or is there a better way to get the number of the <afile>
>> buffer ?
>
> Maybe try bufnr(expand("<afile>"))
No, that doesn't work.
Doing this:
- start vim
- :e somefile
- :tabe
"somefile" gets the nofile buftype.
I've been using it with "$" since then and it hasn't ever done anything
not expected yet. So I guess a new buffer is always the last.
Tinou
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment