oil.nvim
oil.nvim copied to clipboard
fix: using select tab will create extra a blank buffer.
Problem
When using action.select.opts.tab to open a file, an extra blank buffer is created.
This blank buffer comes from the command tabnew, the command will create a blank buffer and empty window, but action.select.opts.tab just to using empty window, does not to using this blank buffer.
https://github.com/stevearc/oil.nvim/blob/302bbaceeafc690e6419e0c8296e804d60cb9446/lua/oil/init.lua#L743-L763
Reproduction
$ nvim --version
NVIM v0.11.0
Build type: None
LuaJIT 2.1.1736781742
Run "nvim -V1 -v" for more info
Typing :Oil<CR><C-t>
How to fix
tabnew has the same properties like edit, so you can just open a buffer directly like edit #<bufnr>.
:[count]tabnew [++opt] [+cmd] {file}
Open a new tab page and edit {file}, like with |:edit|.
For [count] see |:tabnew| above.
*:edit_#* *:e#*
:e[dit] [++opt] [+cmd] #[count]
Edit the [count]th buffer (as shown by |:files|).
This command does the same as [count] CTRL-^. But ":e
#" doesn't work if the alternate buffer doesn't have a
file name, while CTRL-^ still works then.
Also see |++opt| and |+cmd|.
Typing :Oil<CR><C-t>