diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2025-07-12 23:54:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-12 20:54:22 -0700 |
| commit | 89b946aa87d2414bd268f0766d5354cedc5702ff (patch) | |
| tree | 513d43dc49eb64cb7bd236b071114ec8a3abdd99 /runtime/lua/vim/_editor.lua | |
| parent | 5c4f9b05fa4b73ff64a16535af2f0021f83ee0ad (diff) | |
fix(lua): vim.diff is nil in uv.new_work() thread #34909
Problem:
The "gitsigns" plugin runs `vim.diff` in a thread (`uv.new_work`), but
`vim.diff` is nil in that context:
Lua callback:
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: bad argument #1 to 'decode' (string expected, got nil)
stack traceback:
[C]: in function 'decode'
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:30: in function <…/gitsigns.nvim/lua/gitsigns/diff_int.lua:29>
Luv thread:
…/gitsigns.nvim/lua/gitsigns/diff_int.lua:63: attempt to call field 'diff' (a nil value)
Solution:
Revert the `stdlib.c` change (set `vim.diff` instead of `vim._diff`).
Diffstat (limited to 'runtime/lua/vim/_editor.lua')
| -rw-r--r-- | runtime/lua/vim/_editor.lua | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/runtime/lua/vim/_editor.lua b/runtime/lua/vim/_editor.lua index ed8f9f258b..dd9fc221d1 100644 --- a/runtime/lua/vim/_editor.lua +++ b/runtime/lua/vim/_editor.lua @@ -1317,9 +1317,6 @@ require('vim._options') --- Remove at Nvim 1.0 ---@deprecated vim.loop = vim.uv ---- Renamed to `vim.text.diff`, remove at Nvim 1.0 ----@deprecated -vim.diff = vim._diff ---@type fun(a: string, b: string, opts?: vim.text.diff.Opts): string|integer[][]? -- Deprecated. Remove at Nvim 2.0 vim.highlight = vim._defer_deprecated_module('vim.highlight', 'vim.hl') |
