Skip to content

filesystem_watchers.ignore_dirs Handle Windows Paths, Add /.zig-cache To Defaults #3178

@caboyd

Description

@caboyd

Description

nvim-tree.lua spawns infinite watchers when the .zig-cache/tmp folder creates a temporary file during a build process. nvim-tree.lua locks the files and prevents zig from deleting it.

I assume this a windows only issue because windows locks files when they are open.

nvim-tree.log spits out this line 1933 times per second and nvim.exe grows in memory about 10-20 megabytes per second.

[2025-08-07 17:54:56] [watcher] event_cb 'M:\ComputerScience\GitLocal\c-engine\.zig-cache\tmp\2c5da8ef08bfc59e' 'M:\ComputerScience\GitLocal\c-engine\.zig-cache\tmp\2c5da8ef08bfc59e'
[2025-08-07 17:54:56] [watcher] node event scheduled refresh explorer:watch:M:\ComputerScience\GitLocal\c-engine\.zig-cache\tmp\2c5da8ef08bfc59e

Solution

add /.zig-cache to default ignore_dirs for watcher

filesystem_watchers = {
enable = true,
debounce_delay = 50,
ignore_dirs = {
"/.ccls-cache",
"/build",
"/node_modules",
"/target",
},
},

Neovim version

NVIM v0.11.3
Build type: Release
LuaJIT 2.1.1741730670

Operating system and version

Windows 10

Windows variant

Powershell

nvim-tree version

nvim-tree-v1.13.0

Clean room replication

uneccesary

Steps to reproduce

  1. make sure ./zig-cache is not filtered or ignored
  2. nvim
  3. zig build

Expected behavior

No response

Actual behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR pleasenvim-tree team does not have the bandwidth to implement; a PR will be gratefully appreciatedfeature requestperformanceperformance enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions