akinsho / akinsho/git-conflict.nvim
`GitConflictDetected` error when disabling diagnostics on Neovim nightly
- Lingua principale
- Lua
- Stelle
- 1.4k
- Fork
- 70
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I've been running the latest nightly build of Neovim _(`v0.12.0-dev-1271+gc2136e3590` as of today)_, and I get this error when jumping to a merge conflict.
```
Error in User Autocommands for "GitConflictDetected":
Lua callback: ...l/share/nvim/lazy/git-conflict.nvim/lua/git-conflict.lua:652: attempt to call field 'disable' (a nil value)
stack traceback:
...l/share/nvim/lazy/git-conflict.nvim/lua/git-conflict.lua:652: in function <...l/share/nvim/lazy/git-conflict.nvim/lua/git-conflict.lua:650>
[C]: in function 'nvim_exec_autocmds'
...l/share/nvim/lazy/git-conflict.nvim/lua/git-conflict.lua:406: in function 'parse_buffer'
...l/share/nvim/lazy/git-conflict.nvim/lua/git-conflict.lua:479: in function 'process'
```
I tracked it down to disabling diagnostics. I do that in my plugin [config](https://github.com/akinsho/git-conflict.nvim?tab=readme-ov-file#configuration). Here are the lines with the problem:
https://github.com/akinsho/git-conflict.nvim/blob/a1badcd070d176172940eb55d9d59029dad1c5a6/lua/git-conflict.lua#L655 and https://github.com/akinsho/git-conflict.nvim/blob/a1badcd070d176172940eb55d9d59029dad1c5a6/lua/git-conflict.lua#L665
The [API](https://neovim.io/doc/user/diagnostic.html#vim.diagnostic.enable()) for `vim.diagnostic.enable` has changed. I believe this would be an equivalent.
```lua
vim.diagnostic.enable(false, { bufnr })
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.