On Sat, Feb 8, 2020 at 7:01 AM Bram Moolenaar <
Br...@moolenaar.net> wrote:
>
>
> Yegappan wrote:
>
> > The :bunload command unloads an unexpected buffer when
> > an offset is used for the range.
> >
> > For example, let us say we have four buffers (b1, b2, b3 and b4)
> > in the buffer list and only b1 and b2 are loaded. The buffers b3
> > and b4 are not loaded. The current buffer is b1. With this setup,
> > if the following command is executed:
> >
> > .+3bunload
> >
> > The expectation is that buffer b4 will be unloaded. As b4 is not
> > loaded, the command should not do anything. Instead of this
> > behavior, buffer b2 is unloaded. Basically any buffer loaded
> > just before the specified buffer is unloaded. I don't know whether
> > this is intentional or not. This is also not documented.
> >
> > A similar behavior is seen when a negative offset is used.
> >
> > I came across this behavior while developing a test for this.
>
> I would expect that the number is used as-is, thus it does not matter
> which buffers are loaded or not. That is consistent with other buffer
> commands. Would anyone want to go to the Nth loaded buffer? That would
> be quite unpredictable.
>
I agree. The current behavior is unpredictable. Instead of unloading
I am not sure whether anyone relies on this behavior. I think this