-
-
Notifications
You must be signed in to change notification settings - Fork 610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nvim-tree.lua destroys split pattern, and now show the opened buffer #3083
Comments
Next time please follow the instructions when creating the replicator:
On simplifying the toggle I am able to reproduce via:
vim.keymap.set("n", "<leader>n",
function()
nvim_tree_api.tree.toggle(
{
current_window = true,
}
)
end,
{ noremap = true }
) Please note from #3080 that |
Minimal reproducer, both quit-on-open and window-picker-disabled are required. Update-focused-file irrelevant. Any thoughts on this one @GCrispino ? We definitely tested the
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.cmd([[set runtimepath=$VIMRUNTIME]])
vim.cmd([[set packpath=/tmp/nvt-min/site]])
local package_root = "/tmp/nvt-min/site/pack"
local install_path = package_root .. "/packer/start/packer.nvim"
local function load_plugins()
require("packer").startup({
{
"wbthomason/packer.nvim",
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
-- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
},
config = {
package_root = package_root,
compile_path = install_path .. "/plugin/packer_compiled.lua",
display = { non_interactive = true },
},
})
end
if vim.fn.isdirectory(install_path) == 0 then
print("Installing nvim-tree and dependencies.")
vim.fn.system({ "git", "clone", "--depth=1", "https://github.com/wbthomason/packer.nvim", install_path })
end
load_plugins()
require("packer").sync()
vim.cmd([[autocmd User PackerComplete ++once echo "Ready!" | lua setup()]])
vim.opt.termguicolors = true
vim.opt.cursorline = true
local api = require("nvim-tree.api")
vim.keymap.set("n", "<space>a", function()
api.tree.toggle({ current_window = true })
end, { noremap = true })
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
require("nvim-tree").setup({
actions = {
open_file = {
quit_on_open = true,
window_picker = {
enable = false
},
}
},
})
end |
Description
When I open nvim and split, and then toggle with
current_window=true
, and then open a new file from nvim-tree. The split pattern is destroyed, and the opened new file is not on the top.Neovim version
Operating system and version
Linux WorkStation 6.11.0-19-generic #19~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Feb 17 11:51:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Windows variant
No response
nvim-tree version
head
Clean room replication
Steps to reproduce
Expected behavior
The split pattern should keep, and the new opened file should be in the split where nvim-tree is toggled. Here it is [c | b]
Actual behavior
The split pattern is gone, that is only a [a] is here. And the new opened file of "c" is not on top of the shown buffers.
The text was updated successfully, but these errors were encountered: