Nikolai Weibull wrote:
Is <abuf> always guaranteed to be the same as <afile> and is <afile>
always guaranteed to be unique?

 nikolai


1. No. From ":help <afile>":
        <afile>    when executing autocommands, is replaced with the file name
                   for a file read or write
        <abuf>     when executing autocommands, is replaced with the currently
                   effective buffer number (for ":r file" and ":so file" it is
                   the current buffer, the file being read/sourced is not in a
                   buffer).

IOW, for :read and :source, <abuf> is the current buffer and <afile> is not.

2. What do you mean, unique? A file can be opened in several windows, but the buffer will normally be the same (I'm not sure about the case when a file is opened by different names, owing to soft -- or, worse, hard -- links).


Best regards,
Tony.

Reply via email to