Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Does b:undo_ftplugin actually work?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
ZyX  
View profile   Translate to Translated (View Original)
 More options Sep 28 2012, 4:10 pm
From: ZyX <zyx....@gmail.com>
Date: Fri, 28 Sep 2012 13:10:53 -0700 (PDT)
Local: Fri, Sep 28 2012 4:10 pm
Subject: Re: Does b:undo_ftplugin actually work?

суббота, 29 сентября 2012 г., 0:03:23 UTC+4 пользователь ZyX написал:

> > It is not triggered when current and unloaded buffers are different, but
> > when it triggers, current buffer and buffer being unloaded might be
> > different. That is bufnr('%') can be different then "<afile>".

> Is not that what I said?

No it is not. But you are wrong:

    vim -u NONE -c 'autocmd BufUnload * echom expand("<abuf>") bufnr("%")' \
                -c 'vnew' \
                -c 'echom bufnr("%")' \
                -c 'bw! 1'
. You will see
    2
    1 2
. Obviously, that means that current and unloaded buffers are different. You may replace first “echom” with “setlocal” and see that option is set for a wrong buffer. Your autocmd must not be used.

By the way, “bufnr('%')” is almost always different from «"<afile>"». First is buffer number, second is a plain string. Or a filename if you meant “expand("<afile>")”.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.