Replies: 3 comments 2 replies
-
This is a glitch of focus stealing prevention. You tried to open another buffer in neo-tree's window and it was moved into a new window and neo-tree was restored. For some reason, neo-tree opened the new window in the wrong location. This does not happen with my config so it is something unique to your configuration. If you wanted to troubleshoot this, we would need a complete bug report in an issue that includes a minimal config to recreate this. I think the more important question is: why are you intentionally opening another buffer in neo-tree's window? Stop that! |
Beta Was this translation helpful? Give feedback.
-
@6H075T2 did you manage to solve it? |
Beta Was this translation helpful? Give feedback.
-
I tried it with a single plugin on (neotree I mean). lazy-lock.json {
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "cea666ef965884414b1b71f6b39a537f9238bdb2" },
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
"nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" },
"nvim-web-devicons": { "branch": "master", "commit": "3362099de3368aa620a8105b19ed04c2053e38c0" },
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }
} init.lua local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
-- Setup lazy.nvim
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
},
})
-- lazy
vim.keymap.set("n", "<leader>ll", ":Lazy<cr>", { desc = "Open Lazy.nvim", noremap = true, silent = true })
vim.keymap.set("n", "<leader>lr", ":Lazy reload ", { desc = "Open Lazy.nvim", noremap = true, silent = true }) lua/plugins/neotree.lua return {
{
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
pin = true,
dependencies = {
"nvim-lua/plenary.nvim",
"MunifTanjim/nui.nvim",
"nvim-tree/nvim-web-devicons",
},
lazy = false,
opts = {},
keys = {
{
"<leader>e",
function()
require("neo-tree.command").execute({ toggle = true, dir = vim.uv.cwd() })
end,
desc = "Explorer NeoTree (Root Dir)",
remap = true,
},
{
"<leader>E",
function()
local root_dir = Root.root_of_module()
require("neo-tree.command").execute({ toggle = true, dir = root_dir })
end,
desc = "Explorer NeoTree (Package Dir)",
remap = true,
},
{
"<leader>ge",
function()
require("neo-tree.command").execute({ source = "git_status", toggle = true })
end,
desc = "Git Explorer",
},
{
"<leader>be",
function()
require("neo-tree.command").execute({ source = "buffers", toggle = true })
end,
desc = "Buffer Explorer",
},
},
},
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How to avoid this? This happens with I open two buffers and delete the other one neo-tree stays but with empty buffer but if i toggle neo-tree it switches from the last buffer and neo-tree buffer it doesn't attach itself to the last buffer, and if I go the next buffer with :bnext command neo-tree goes to right.
RECORDING.mp4
Beta Was this translation helpful? Give feedback.
All reactions