Skip to content

GitConflictDetected error when disabling diagnostics on Neovim nightly #119

@wassimk

Description

@wassimk

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. Here are the lines with the problem:

if config.disable_diagnostics then vim.diagnostic.disable(bufnr) end
and
if config.disable_diagnostics then vim.diagnostic.enable(bufnr) end

The API for vim.diagnostic.enable has changed. I believe this would be an equivalent.

vim.diagnostic.enable(false, { bufnr })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions