Description
- OpenDir
- OpenFile
- :lua vim.lsp.buf.definition() on fmt.Println
the buf changed to print.go,the scan.go buf is because of the lsp's diagnostic
if without this,close the opened file main.go directly,everything works fine
- :bw
close the current buf
here is the problem!
the NvimTree_1 hijack the window
we can see the main.go in the buf list,there has no prefix path,so the current buf already changed to the main.go
- :bn
change to next buf
Neovim version
NVIM v0.12.1
Build type: Release
LuaJIT 2.1.1774638290
Operating system and version
windows 11 amd64
Windows variant
windows terminal app with powershell
nvim-tree version
"nvim-tree.lua": { "branch": "master", "commit": "509962f21ab7289d8dcd28568af539be39a8c01e" }
Clean room replication
require('lazy').setup({
{
'kyazdani42/nvim-tree.lua',
opts={
on_attach=function(bufnr)
local api = require('nvim-tree.api')
api.config.mappings.default_on_attach(bufnr)
vim.keymap.del('n','f',{ buffer = bufnr })
vim.keymap.del('n','F',{ buffer = bufnr })
vim.keymap.del('n','q',{ buffer = bufnr })
vim.keymap.set('n','f',api.tree.toggle)
vim.keymap.set('n','F',api.tree.toggle)
-- <C-_> is <C-/>
vim.keymap.set('n','<C-_>',function()api.tree.open();api.live_filter.start();end)
vim.keymap.set('n','<M-/>',function()api.tree.open();api.live_filter.start();end)
vim.keymap.set('n','?',api.tree.toggle_help)
end,
disable_netrw=true,
hijack_netrw=true,
hijack_unnamed_buffer_when_opening=true,
prefer_startup_root=true,
sync_root_with_cwd=true,
reload_on_bufenter=true,
respect_buf_cwd=true,
update_focused_file = {
enable = true,
update_root = {
enable = true,
ignore_list = {},
},
exclude = false,
},
diagnostics = {
enable = true,
show_on_dirs = false,
show_on_open_dirs = true,
icons = {
hint = "H",
info = "I",
warning = "W",
error = "E",
},
},
},
lazy=false,
},
})
Steps to reproduce
see the Description
Expected behavior
when close the buf created by lsp's definition,the NvimTree_1 will not hijack the window
Actual behavior
when close the buf created by lsp's definition,the NvimTree_1 will hijack the window
see the step 4
Description
the buf changed to
print.go,thescan.gobuf is because of the lsp's diagnosticif without this,close the opened file main.go directly,everything works fine
close the current buf
here is the problem!
the NvimTree_1 hijack the window
we can see the main.go in the buf list,there has no prefix path,so the current buf already changed to the main.go
change to next buf
Neovim version
Operating system and version
windows 11 amd64
Windows variant
windows terminal app with powershell
nvim-tree version
"nvim-tree.lua": { "branch": "master", "commit": "509962f21ab7289d8dcd28568af539be39a8c01e" }
Clean room replication
Steps to reproduce
see the Description
Expected behavior
when close the buf created by lsp's definition,the NvimTree_1 will not hijack the window
Actual behavior
when close the buf created by lsp's definition,the NvimTree_1 will hijack the window
see the step 4