From 30f32afdb1f5fdb166ac44bb680d3526fa289262 Mon Sep 17 00:00:00 2001 From: Nick Pisani Date: Wed, 15 Jul 2026 07:27:24 -0400 Subject: [PATCH] fix(path): use os.getenv instead of vim.env in PathLib:expand vim.env's __index is backed by Vimscript's getenv(), which requires Neovim's main/textlock context. PathLib:expand (via PathLib:absolute) is called while processing paths from git subprocess output, which happens inside libuv fast-event callbacks on Neovim 0.10+, throwing an E5560-class error. os.getenv is a plain Lua/C call safe from any context. Co-Authored-By: Claude Sonnet 5 --- lua/diffview/path.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/diffview/path.lua b/lua/diffview/path.lua index 0a5af9fd..8bd9c7ea 100644 --- a/lua/diffview/path.lua +++ b/lua/diffview/path.lua @@ -340,7 +340,7 @@ function PathLib:expand(path) for i = idx, #segments do local env_var = segments[i]:match("^%$(%S+)$") if env_var then - local value = vim.env[env_var] + local value = os.getenv(env_var) if value ~= nil then segments[i] = value end