akinsho / akinsho/git-conflict.nvim

`GitConflictDetected` error when disabling diagnostics on Neovim nightly

オープン
#119 コメント 1 件 リアクション 3 件 担当者 0 名 GitHub で見る
主要言語
Lua
スター
1.4k
フォーク
70
PR マージ指標
30日以内にマージされた PR はありません

説明

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 })
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。