mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
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`).
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user