Is your feature request related to a problem? Please describe.
When using Bdelete or Bwipe with a text/string parameter to close a buffer, if the term matches multiple buffers one will be closed seemingly at random. This is particularly problematic when a buffer's relative file path matches the term and not the file name.
Example:
My neovim config directory has the following files:
lua/neandrake/lazy.lua
lua/neandrake/lazy_plugins/bufdelete.lua
lua/neandrake/lazy_plugins/... .lua
I then run :Bdel lazy with the intent to close lazy.lua but bufdelete.lua ends up closing. This happens because the buffer's name is the relative-to-cwd path + filename of the file, in this case lua/neandrake/lazy_plugins/bufdelete.lua and lazy matched the path element lazy_plugins. Presumably this would happen not at random but first match in order of what buffers were opened first.
Describe the solution you'd like
Update matching behavior, or an option to do so, such that if multiple buffers match the search term then no buffers are closed. Alternatively only match on the filename part of the name, if it's reliable to do so.
Describe alternatives you've considered
Closing by buffer ID instead of by name matching.
Additional context
I use bufferline plugin to show UI-tabs for opened buffers, configured to display only the buffer's filename for each UI-tab. When using :Bd lazy I was confused to what happened as something had closed but not lazy.lua.
Is your feature request related to a problem? Please describe. When using
Bdelete
orBwipe
with a text/string parameter to close a buffer, if the term matches multiple buffers one will be closed seemingly at random. This is particularly problematic when a buffer's relative file path matches the term and not the file name.Example: My neovim config directory has the following files:
lua/neandrake/lazy.lua
lua/neandrake/lazy_plugins/bufdelete.lua
lua/neandrake/lazy_plugins/... .lua
I then run
:Bdel lazy
with the intent to closelazy.lua
butbufdelete.lua
ends up closing. This happens because the buffer's name is the relative-to-cwd path + filename of the file, in this caselua/neandrake/lazy_plugins/bufdelete.lua
andlazy
matched the path elementlazy_plugins
. Presumably this would happen not at random but first match in order of what buffers were opened first.Describe the solution you'd like Update matching behavior, or an option to do so, such that if multiple buffers match the search term then no buffers are closed. Alternatively only match on the filename part of the name, if it's reliable to do so.
Describe alternatives you've considered Closing by buffer ID instead of by name matching.
Additional context I use
bufferline
plugin to show UI-tabs for opened buffers, configured to display only the buffer's filename for each UI-tab. When using:Bd lazy
I was confused to what happened as something had closed but notlazy.lua
.