Hi Bram,

On Sat, Feb 8, 2020 at 7:01 AM Bram Moolenaar <[email protected]> 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
a specified buffer, the command will unload any loaded buffer just
before or after the specified buffer if the specified buffer is not loaded.
This happens only when a range offset is used to specify the buffer.
I am not sure whether anyone relies on this behavior. I think this
should be fixed so that only the specified buffer is unloaded.

- Yegappan

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAAW7x7%3Dvmc0%2BoP0nCgZ-%2BAwWPK-Pc%2Bczxc9J1r736RbDMPXDwg%40mail.gmail.com.

Raspunde prin e-mail lui