E367: No such group "--Deleted--" in Explorer:destroy when core.init is re-entered during a git runner wait
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start with lua/nvim-tree/explorer/init.lua around Explorer:destroy and new, then trace the reentrant initialization through lua/nvim-tree/core.lua and the git runner wait. Reproduce with the two repositories and delayed git wrapper from the issue. Done when changing the tree root to /tmp/nvt-b during the wait no longer raises E367.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
Opening a file in a directory that is not under the tree root can fail with:
E367: No such group: "--Deleted--" at explorer/init.lua:81 (Explorer:destroy)
The failure is intermittent. It occurs when a global :cd (e.g. from
project.nvim on BufEnter) changes the working directory to another project
while the tree is rooted elsewhere. A slow git status (large repository) makes it more likely.
Neovim version
NVIM v0.12.6
Build type: RelWithDebInfo
LuaJIT 2.1.1788856981
Operating system and version
Linux 7.2.9-arch1-1
Windows variant
No response
nvim-tree version
master 355bcc8
Clean room replication
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",
},
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
-- MODIFY NVIM-TREE SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
_G.setup = function()
require("nvim-tree").setup({
-- legacy `update_cwd = true` migrates to this
sync_root_with_cwd = true,
-- legacy `update_focused_file = { enable = true, update_cwd = true }` migrates to this
update_focused_file = { enable = true, update_root = { enable = true } },
})
-- simulate project.nvim, which performs a global :cd to the project root on BufEnter
vim.api.nvim_create_autocmd("BufEnter", {
callback = function()
if vim.bo.buftype == "" and vim.fn.filereadable(vim.fn.expand("%:p")) == 1 then
vim.schedule(function()
vim.cmd("cd /tmp/nvt-b")
end)
end
end,
})
end
Steps to reproduce
Two git repositories are necessary: the tree is opened in the first and a
file is edited in the second. A git wrapper delays every git invocation by
200ms to deterministically widen the race window between the 15ms debounce
and the git job; on a sufficiently large/slow repository the wrapper is not
required.
mkdir -p /tmp/nvt-a /tmp/nvt-b
cd /tmp/nvt-a && git init -q && git commit -q --allow-empty -m a
cd /tmp/nvt-b && git init -q && echo x > f.txt && git add f.txt && git commit -qm b
mkdir -p /tmp/nvt-bin
printf '#!/bin/sh\nsleep 0.2\nexec git "$@"\n' > /tmp/nvt-bin/git
chmod +x /tmp/nvt-bin/git
cd /tmp/nvt-a
PATH=/tmp/nvt-bin:$PATH nvim -nu /tmp/nvt-min.lua
In neovim,
:NvimTreeOpen<C-w>pto focus the original window (tree open, not focused):edit /tmp/nvt-b/f.txt
Expected behavior
Tree root changes to /tmp/nvt-b without error.
Actual behavior
vim.schedule callback: .../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:81: Vim:E367: No such group: "--Deleted--"
stack traceback:
[C]: in function 'nvim_del_augroup_by_id'
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:81: in function 'destroy'
.../nvim-tree.lua/lua/nvim-tree/core.lua:19: in function 'init'
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:806: in function 'force_dirchange'
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:839: in function 'change_dir'
.../nvim-tree.lua/lua/nvim-tree/actions/tree/change-root.lua:42: in function 'fn'
.../nvim-tree.lua/lua/nvim-tree/actions/tree/find-file.lua:62: in function 'fn'
.../nvim-tree.lua/lua/nvim-tree/autocmd.lua:68: in function 'callback'
.../nvim-tree.lua/lua/nvim-tree/utils.lua:351: in function <.../nvim-tree.lua/lua/nvim-tree/utils.lua:350>
[C]: in function 'wait'
.../nvim-tree.lua/lua/nvim-tree/git/runner.lua:209: in function 'wait'
...
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:75: in function 'new'
.../nvim-tree.lua/lua/nvim-tree/classic.lua:186: in function <.../nvim-tree.lua/lua/nvim-tree/classic.lua:184>
.../nvim-tree.lua/lua/nvim-tree/core.lua:30: in function 'init'
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:806: in function 'force_dirchange'
.../nvim-tree.lua/lua/nvim-tree/explorer/init.lua:839: in function 'change_dir'
.../nvim-tree.lua/lua/nvim-tree/actions/tree/change-dir.lua:11: in function 'fn'
.../nvim-tree.lua/lua/nvim-tree/autocmd.lua:55: in function <.../nvim-tree.lua/lua/nvim-tree/autocmd.lua:54>
[C]: in function 'nvim_exec2'
- Ngôn ngữ chính
- Lua
- Star
- 8.7k
- Fork
- 639
- Merge trung bình
- 8 giờ 25 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nvim-tree/nvim-tree.lua
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nvim-tree/nvim-tree.lua#3362 · 1 bình luận ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nvim-tree/nvim-tree.lua#3361 ·
-
Use vim.Option getters and setters instead of directly settingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
nvim-tree/nvim-tree.lua#3357 · 1 bình luận ·
-
Migrate To vim.packĐang mởdocumentation PR please
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
nvim-tree/nvim-tree.lua#3179 · 6 bình luận ·
-
upstream: neovim
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
nvim-tree/nvim-tree.lua#3344 · 1 bình luận ·
Tất cả issue của nvim-tree/nvim-tree.lua
Issue tương tự
-
Add event count to export UIĐang mởFeature Request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Questie/QuestieTrace#92 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Forever: Forgotten Loa Idols (97225) needs Report to Sen’jin Village (805) as a prerequisiteĐang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
WitchĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
LuaLS/lua-language-server#3471 ·
-
RadlNavi Routing V2.3.5 Rechts/Links Kombinationen halb unterdrücktCó thể đã có người làm @thomas-munichways đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
bug good first issue ready ticket
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Domktorymysli/vclu#20 ·